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>

Inheritance diagram for LOW_network:

Inheritance graph
[legend]
Collaboration diagram for LOW_network:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LOW_network ()
 Constructor.

virtual ~LOW_network ()
 Destructor.

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

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

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

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

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

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

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


Private Member Functions

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


Private Attributes

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

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


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).

This class is thread-safe.

Todo:
COPY CONSTRUCTOR AND ASSIGNMENT OPERATOR.

Add multi-segment support.

Author:
Harald Roelle

Definition at line 42 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  )  [virtual]
 

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  )  [virtual]
 

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 __LOW_SYNCHRONIZE_METHOD_WRITE_WEAK__, addSegments(), and linkList.

void LOW_network::addSegments LOW_link inLink  )  [private, virtual]
 

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 116 of file LOW_network.cpp.

References __LOW_SYNCHRONIZE_METHOD_WRITE_WEAK__, 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 201 of file LOW_network.h.

References __LOW_SYNCHRONIZE_METHOD_READ__, and segmentsList.

template<class devType>
std::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 215 of file LOW_network.h.

References __LOW_SYNCHRONIZE_METHOD_READ__, and segmentsList.

LOW_netSegment::netSegPtrVec_t LOW_network::getSegments  )  const [virtual]
 

Get list of all network segments on the network.

Returns:
List of all segments.

Definition at line 85 of file LOW_network.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, LOW_netSegment::netSegPtrVec_t, and segmentsList.

void LOW_network::removeLink LOW_link inLink  )  [virtual]
 

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 58 of file LOW_network.cpp.

References __LOW_SYNCHRONIZE_METHOD_WRITE__, linkList, and segmentsList.

template<class devType>
std::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 231 of file LOW_network.h.

References __LOW_SYNCHRONIZE_METHOD_READ__, and segmentsList.

bool LOW_network::verifyDevice const LOW_deviceID  inDevID,
const bool  inOnlyAlarm = false
const [virtual]
 

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 94 of file LOW_network.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__.


Member Data Documentation

LOW_link::linkPtrVec_t LOW_network::linkList [private]
 

List of links the network consts of.

Definition at line 173 of file LOW_network.h.

Referenced by addLink(), and removeLink().

LOW_netSegment::netSegPtrVec_t LOW_network::segmentsList [private]
 

List of all segments on the network.

Definition at line 172 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 Tue Feb 3 11:31:02 2004 for OneWireLibrary++ by doxygen 1.3.2