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

DAQThreadId Class Reference

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

Inheritance diagram for DAQThreadId::

DAQNodeId DAQExecId DAQObject Printable List of all members.

Public Methods

 DAQThreadId ()
 Constructor. More...

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

 ~DAQThreadId ()
 Destructor. More...

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

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

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

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

DAQString EncodeAsString (void)
 Encode this thread id a string. More...

bool DecodeFromString (DAQString &)
 Encode this thread id a string. More...

bool DecodeFromString (char *)
 Encode this thread id a string (char*). More...

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

bool Peers (DAQThreadId &)
 Determine if two threads are on the same machine. More...

bool PeerThreads (DAQThreadId &)
 Determine if two threads are in the same process. More...


Protected Methods

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

void CopyToThis (const DAQThreadId &)
 Copy a thread id to this id.

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


Friends

class DAQThread
class DAQThreadFactory
int __spectrodaq_daqthread_join (DAQThreadId &, DAQStatus *)
void * DAQThread_Initialize (void *)

Detailed Description

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

Author:
Eric Kasten
Version:
0.4.0


Constructor & Destructor Documentation

DAQThreadId::DAQThreadId
 

Basic constructor method for this class.

Parameters:
None  
Returns:
this

DAQThreadId::DAQThreadId const DAQThreadId & aThreadId
 

Copy constructor method for this class.

Parameters:
aThreadId   Another DAQThreadId to copy.
Returns:
this

DAQThreadId::~DAQThreadId
 

Class Destructor.

Parameters:
None  
Returns:
None


Member Function Documentation

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

Copy a node id into this. This results in this and the node id being equal under operator==

Parameters:
aNodeId   Set this equal to aNodeId
Returns:
None

Reimplemented from DAQNodeId.

bool DAQThreadId::DecodeFromString char * pStr [virtual]
 

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

Parameters:
pStr   A string (char*) representation of a thread 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 from DAQNodeId.

bool DAQThreadId::DecodeFromString DAQString & aStr [virtual]
 

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

Parameters:
aStr   A string representation of a thread 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 from DAQNodeId.

DAQString DAQThreadId::EncodeAsString void [virtual]
 

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

Parameters:
None  
Returns:
A DAQString representation of this.

Reimplemented from DAQNodeId.

bool DAQThreadId::PeerThreads DAQThreadId & aThreadId
 

Check if this thread Id is in the same process as the provided Id.

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

bool DAQThreadId::Peers DAQThreadId & aThreadId
 

DAQThreadId::Peers(DAQThreadId& aThreadId)

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

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

ostream & DAQThreadId::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 DAQNodeId.

int DAQThreadId::Reset [protected]
 

Reset this thread id such that it represents the thread that currently owns this thread id object 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 from DAQNodeId.

DAQThreadId & DAQThreadId::operator= const DAQNodeId & aNodeId
 

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

Parameters:
aNodeId   Set this equal to aNodeId
Returns:
this

Reimplemented from DAQNodeId.

DAQThreadId & DAQThreadId::operator= const DAQThreadId & aThreadId
 

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

Parameters:
aThreadId   Set this equal to aThreadId
Returns:
this

bool DAQThreadId::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, process and thread as the one represented by this.

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

Reimplemented from DAQNodeId.

bool DAQThreadId::operator== const DAQThreadId & aThreadId
 

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

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


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