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

DAQNodeId Class Reference

Provides methods for manipulating and displaying a node id. More...

Inheritance diagram for DAQNodeId::

DAQExecId DAQObject Printable DAQThreadId List of all members.

Public Methods

 DAQNodeId ()
 Constructor. More...

 DAQNodeId (const DAQNodeId &)
 Copy constructor. More...

 ~DAQNodeId ()
 Destructor. More...

bool operator== (const DAQNodeId &)
 Check if a node id is equal to this. More...

DAQNodeId & operator= (const DAQNodeId &)
 Assignment. More...

DAQNodeId & operator= (const DAQNodeLocation &)
 Assignment. More...

DAQNodeId & operator= (const DAQNodeLocation_t &)
 Assignment. More...

virtual DAQString EncodeAsString (void)
 Encode Id as a string. More...

virtual bool DecodeFromString (DAQString &)
 Decode node id from a DAQString. More...

virtual bool DecodeFromString (char *)
 Decode node id from a string (char*). More...

ostream & Print (ostream &)
 Print this Id. More...

bool Peers (DAQNodeId &)
 Check if two node ids are peers. More...

DAQNodeLocation & Get ()
 Return the raw node location. More...


Protected Methods

int Reset ()
 Reset the node id. More...

bool Copy (const DAQNodeLocation &)
 Copy a location into this. More...

bool Copy (const DAQNodeLocation_t &)
 Copy a location struct into this. More...

void CopyToThis (const DAQNodeId &)
 Copy a node id into this. More...


Protected Attributes

DAQNodeLocation location
 Node id data. More...


Friends

class DAQNode
class DAQThread
class DAQThreadId
class DAQThreadMutex
class DAQNodeFactory
class DAQThreadFactory
class DAQPeriodicEventMgr
class DAQInterfaceMgr

Detailed Description

The DAQNodeId class provides methods that allow the identifier of a DAQNode to be manipulated or displayed. Typically, the string representation (as returned by EncodeAsString()) of a DAQNodeId is of the form <Node IPaddr>:<PID>.

Author:
Eric Kasten
Version:
0.4.0


Constructor & Destructor Documentation

DAQNodeId::DAQNodeId
 

Basic constructor method for this class.

Parameters:
None  
Returns:
this

DAQNodeId::DAQNodeId const DAQNodeId & aId
 

Copy constructor method for this class.

Parameters:
aId   Another DAQNodeId to copy.
Returns:
this

DAQNodeId::~DAQNodeId
 

Class Destructor.

Parameters:
None  
Returns:
None


Member Function Documentation

bool DAQNodeId::Copy const DAQNodeLocation_t & aLoc [protected]
 

Copy the data structure (struct DAQNodeLocation_t) of another node id in this this. After the copy this and the one supplied are considered equal under operator==.

Parameters:
aLoc   A struct DAQNodeLocation_t
Returns:
If the the copy was successful.
Return values:
true   The copy was successful.
false   The copy wasn't succesful.

bool DAQNodeId::Copy const DAQNodeLocation & aLoc [protected]
 

Copy the data structure (DAQNodeLocation) of another node id in this this. After the copy this and the one supplied are considered equal under operator==.

Parameters:
aLoc   A DAQNodeLocation
Returns:
If the the copy was successful.
Return values:
true   The copy was successful.
false   The copy wasn't succesful.

void DAQNodeId::CopyToThis const DAQNodeId & aNodeId [protected]
 

Copy another node id into this. This results in the two node ids being equal under operator==

Parameters:
aNodeId   Set this equal to aNodeId
Returns:
None

Reimplemented in DAQThreadId.

bool DAQNodeId::DecodeFromString char * pStr [virtual]
 

Initialize this from a string representation of a node id. The string representation must be of the form <IPaddr>:<PID>.

Parameters:
pStr   A string (char*) representation of a node id.
Returns:
Success or failure of the string decoding.
Return values:
true   If the decoding was successful.
false   If the decoding wasn't successful.

Reimplemented in DAQThreadId.

bool DAQNodeId::DecodeFromString DAQString & aStr [virtual]
 

Initialize this from a string representation of a node id. The string representation must be of the form <IPaddr>:<PID>.

Parameters:
aStr   A string representation of a node id.
Returns:
Success or failure of the string decoding.
Return values:
true   If the decoding was successful.
false   If the decoding wasn't successful.

Reimplemented in DAQThreadId.

DAQString DAQNodeId::EncodeAsString void [virtual]
 

Return a DAQString representation of this. Typically, this is a string of the form <IPaddr>:<PID>.

Parameters:
None  
Returns:
A DAQString representation of this.

Reimplemented in DAQThreadId.

DAQNodeLocation & DAQNodeId::Get
 

Return the underlying data structure (DAQNodeLocation) of this node id.

Parameters:
None  
Returns:
The DAQNodeLocation for this.

bool DAQNodeId::Peers DAQNodeId & aId
 

Check if this node Id is on the same machine as the provided Id.

Parameters:
aId   Another node id.
Returns:
Whether aId is a peer of this.
Return values:
true   The node ids are peers.
false   The node ids are not peers.

DAQNodeId::Print ostream & aStream [virtual]
 

Print the string representation of this on an output stream.

Parameters:
aStream   The output stream on which to print this.
Returns:
A reference to the output stream.

Reimplemented from DAQObject.

Reimplemented in DAQThreadId.

int DAQNodeId::Reset [protected]
 

Reset this node id such that it represents a node on this host.

Parameters:
None  
Returns:
An indication of failure or success.
Return values:
0   Success
=0   An error code typically indicating a host error (h_errno) .

Reimplemented in DAQThreadId.

DAQNodeId & DAQNodeId::operator= const DAQNodeLocation_t & aNodeLoc
 

Assign a struct DAQNodeLocation_t to this.

Parameters:
aNodeLoc   Assign aNodeLoc to this.
Returns:
this

DAQNodeId & DAQNodeId::operator= const DAQNodeLocation & aNodeLoc
 

DAQNodeId::operator=(const DAQNodeLocation &aNodeLoc)

Assign a DAQNodeLocation to this.

Parameters:
aNodeLoc   Assign aNodeLoc to this.
Returns:
this

DAQNodeId & DAQNodeId::operator= const DAQNodeId & aNodeId
 

Assign another node id to this. This results in the two node ids being equal under operator==

Parameters:
aNodeId   Set this equal to aNodeId
Returns:
this

Reimplemented in DAQThreadId.

bool DAQNodeId::operator== const DAQNodeId & aNodeId
 

Check if the specified node id is equal to this. That is, return true if the specified node id represents the name host and process as the one represented by this.

Parameters:
aId   Another node id.
Returns:
If aId is equivalent to this.
Return values:
true   aId is equivalent to this.
false   aId is not equivalent to this.

Reimplemented in DAQThreadId.


Member Data Documentation

DAQNodeId::location [protected]
 

A struct representing the basic data used to represent a node id.


The documentation for this class was generated from the following files:
Generated at Tue Jan 29 14:07:09 2002 for SpectroDAQ by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001