Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LOW_network Class Reference

Class to represent a whole 1-Wire network. More...

#include <LOW_network.h>

List of all members.

Public Methods

 LOW_network ()
 Constructor. More...

 ~LOW_network ()
 Destructor. More...

void addLink (LOW_link *inLink)
 Add a link to the network. More...

void removeLink (LOW_link *inLink)
 Remove a link from the network. More...

LOW_netSegment::netSegPtrVec_t getSegments () const
 Get list of all network segments on the network. More...

template<class devType> devType * getDevice (const LOW_deviceID inDevID) const
 Get a specific device. More...

template<class devType> vector< devType *> getDevices () const
 Get devices of a specific type. More...

template<class devType> vector< devType *> searchDevices (const bool inOnlyAlarm=false) const
 Search for devices on the network. More...

bool verifyDevice (const LOW_deviceID inDevID, const bool inOnlyAlarm=false) const
 Verify existance of a specific device on the network. More...


Protected Methods

void addSegments (LOW_link &inLink)
 Trigger discovery of network segments. More...


Protected Attributes

LOW_netSegment::netSegPtrVec_t segmentsList
 List of all segments on the network. More...

LOW_link::linkPtrVec_t linkList
 List of links the network consts of. More...


Detailed Description

Class to represent a whole 1-Wire network.

A network consists of multiple links (LOW_link). On a link there is at least one segment (LOW_netSegment).

Todo:
Add multi-segment support.

Author:
Harald Roelle, Helmut Reiser

Definition at line 36 of file LOW_network.h.


Constructor & Destructor Documentation

LOW_network::LOW_network  
 

Constructor.

Definition at line 26 of file LOW_network.cpp.

LOW_network::~LOW_network  
 

Destructor.

Automatically disposes all segments.

Definition at line 31 of file LOW_network.cpp.

References segmentsList.


Member Function Documentation

void LOW_network::addLink LOW_link   inLink
 

Add a link to the network.

Triggers discovery of network segments. Returns silently when link is already registered.

Parameters:
inLink  The link to be added.

Definition at line 44 of file LOW_network.cpp.

References addSegments(), and linkList.

void LOW_network::addSegments LOW_link   inLink [protected]
 

Trigger discovery of network segments.

Found segments are added to the internal segment list.

Parameters:
inLink  The link where segments should be discovered on.

Definition at line 108 of file LOW_network.cpp.

References LOW_netSegment::netSegPtrVec_t, LOW_netSegment::newSegmentsFromLink(), and segmentsList.

Referenced by addLink().

template<class devType>
devType * LOW_network::getDevice const LOW_deviceID    inDevID const
 

Get a specific device.

Devices are searched in the internal lists of all segments only. No bus actions are performed.

Note::The device type to look for is selected by the template parameter.

Parameters:
inDevID  ID of the device to get.
Returns:
Requested device.

Definition at line 194 of file LOW_network.h.

References segmentsList.

template<class devType>
vector< devType *> LOW_network::getDevices   const
 

Get devices of a specific type.

Devices are searched in the internal lists of all segments only. No bus actions are performed. Selecting any device type will result in the complete list of devices known to be present on the network.

Note:: The device type to look for is selected by the template parameter. To select any device type use LOW_device.

Returns:
Vector of found devices.

Definition at line 206 of file LOW_network.h.

References segmentsList.

LOW_netSegment::netSegPtrVec_t LOW_network::getSegments   const
 

Get list of all network segments on the network.

Returns:
List of all segments.

Definition at line 81 of file LOW_network.cpp.

References LOW_netSegment::netSegPtrVec_t, and segmentsList.

void LOW_network::removeLink LOW_link   inLink
 

Remove a link from the network.

Destroys all segments on this link.

Parameters:
inLink  The link to be removed.
Exceptions:
network_error  When link is not registered.

Definition at line 56 of file LOW_network.cpp.

References linkList, and segmentsList.

template<class devType>
vector< devType *> LOW_network::searchDevices const bool    inOnlyAlarm = false const
 

Search for devices on the network.

Selecting any device type will result in searching the whole network.

Note:: The device type to look for is selected by the template parameter. To select any device type use LOW_device.

Note:: The bus will be actively searched. Newly found devices will be added to the internal lists of the segments.

Parameters:
inOnlyAlarm  Determines whether to look only for alarming devices of the requested type.
Returns:
Vector of found devices.

Definition at line 220 of file LOW_network.h.

References segmentsList.

bool LOW_network::verifyDevice const LOW_deviceID    inDevID,
const bool    inOnlyAlarm = false
const
 

Verify existance of a specific device on the network.

Note:: In case you already own a reference to the device, use the corresponding method from LOW_device.

Note:: The bus will be actively searched. Newly found devices will be added to the internal lists of the segments.

Parameters:
inDevID  ID of the device to verify.
inOnlyAlarm  Determines whether to report existance only when the device is alarming.
Returns:
Boolean indicates wheter the device could be found or not.

Definition at line 88 of file LOW_network.cpp.

References LOW_device::verifyDevice().


Member Data Documentation

LOW_link::linkPtrVec_t LOW_network::linkList [protected]
 

List of links the network consts of.

Definition at line 166 of file LOW_network.h.

Referenced by addLink(), and removeLink().

LOW_netSegment::netSegPtrVec_t LOW_network::segmentsList [protected]
 

List of all segments on the network.

Definition at line 165 of file LOW_network.h.

Referenced by addSegments(), getDevice(), getDevices(), getSegments(), removeLink(), searchDevices(), and ~LOW_network().


The documentation for this class was generated from the following files:
Generated on Sun Jan 12 21:07:57 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001