Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Net::ONetwork Class Reference

A container class for all network interfaces. More...

#include </home/clem/local/src/opie/libopie2/opienet/onetwork.h>

Collaboration diagram for Opie::Net::ONetwork:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QDict< ONetworkInterfaceInterfaceMap
typedef QDictIterator< ONetworkInterfaceInterfaceIterator

Public Member Functions

int count () const
InterfaceIterator iterator () const
bool isPresent (const char *interface) const
bool isWirelessInterface (const char *interface) const
ONetworkInterfaceinterface (const QString &interface) const
void synchronize ()

Static Public Member Functions

static ONetworkinstance ()
static short wirelessExtensionCompileVersion ()

Protected Member Functions

 ONetwork ()

Private Attributes

InterfaceMap _interfaces
Private * d

Static Private Attributes

static ONetwork_instance = 0

Detailed Description

A container class for all network interfaces.

This class provides access to all available network interfaces of your computer.

Author:
Michael 'Mickey' Lauer <mickey@vanille.de>

Definition at line 71 of file onetwork.h.


Member Typedef Documentation

typedef QDictIterator<ONetworkInterface> Opie::Net::ONetwork::InterfaceIterator
 

Definition at line 77 of file onetwork.h.

typedef QDict<ONetworkInterface> Opie::Net::ONetwork::InterfaceMap
 

Definition at line 73 of file onetwork.h.


Constructor & Destructor Documentation

Opie::Net::ONetwork::ONetwork  )  [protected]
 

Definition at line 77 of file onetwork.cpp.

References odebug, oendl, and synchronize().

Referenced by instance().


Member Function Documentation

int Opie::Net::ONetwork::count  )  const
 

Returns:
the number of available interfaces

Definition at line 132 of file onetwork.cpp.

References _interfaces, and QDict< type >::count().

ONetwork * Opie::Net::ONetwork::instance  )  [static]
 

Returns:
a pointer to the (one and only) ONetwork instance.

Definition at line 144 of file onetwork.cpp.

References _instance, and ONetwork().

Referenced by NetworkAppletControl::build(), WirelessApplet::checkInterface(), IfaceIPAddress::IfaceIPAddress(), IfaceUpDownButton::IfaceUpDownButton(), main(), WLANImp::rescanNeighbourhood(), Stumbler::setIface(), NetworkAppletControl::sizeHint(), Stumbler::start(), Stumbler::Stumbler(), WirelessApplet::timerEvent(), and WellenreiterConfigWindow::WellenreiterConfigWindow().

ONetworkInterface * Opie::Net::ONetwork::interface const QString interface  )  const
 

Returns:
a pointer to the ONetworkInterface object for the specified interface or 0, if not found.
See also:
ONetworkInterface

Definition at line 138 of file onetwork.cpp.

References _interfaces.

Referenced by Wellenreiter::startClicked(), and Wellenreiter::Wellenreiter().

bool Opie::Net::ONetwork::isPresent const char *  interface  )  const
 

Returns:
true, if the interface is present.

Definition at line 157 of file onetwork.cpp.

Referenced by Wellenreiter::startClicked().

bool Opie::Net::ONetwork::isWirelessInterface const char *  interface  )  const
 

Returns:
true, if the interface supports the wireless extension protocol.

Definition at line 168 of file onetwork.cpp.

Referenced by synchronize().

ONetwork::InterfaceIterator Opie::Net::ONetwork::iterator  )  const
 

Returns:
an iterator usable for iterating through all network interfaces.

Definition at line 151 of file onetwork.cpp.

References _interfaces.

Referenced by WirelessApplet::checkInterface(), main(), and Wellenreiter::Wellenreiter().

void Opie::Net::ONetwork::synchronize  ) 
 

For internal use only.

Rebuild the internal interface database

Note:
Sometimes it might be useful to call this from client code, e.g. after issuing a cardctl insert

Definition at line 84 of file onetwork.cpp.

References _interfaces, QTextStream::atEnd(), QDict< type >::clear(), f, QDict< type >::insert(), IO_ReadOnly, isWirelessInterface(), odebug, oendl, QFile::open(), QTextStream::readLine(), s, str, and QString::truncate().

Referenced by WirelessApplet::checkInterface(), and ONetwork().

short Opie::Net::ONetwork::wirelessExtensionCompileVersion  )  [static]
 

Returns:
the wireless extension version used at compile time.

Definition at line 126 of file onetwork.cpp.


Member Data Documentation

ONetwork * Opie::Net::ONetwork::_instance = 0 [static, private]
 

Definition at line 75 of file onetwork.cpp.

Referenced by instance().

InterfaceMap Opie::Net::ONetwork::_interfaces [private]
 

Definition at line 121 of file onetwork.h.

Referenced by count(), interface(), iterator(), and synchronize().

Private* Opie::Net::ONetwork::d [private]
 

Definition at line 122 of file onetwork.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:36 2005 for OPIE by  doxygen 1.4.2