IdObject Class Reference
[PEARL.base]

Base class for entities with a numerical identifier. More...

#include <IdObject.h>

Inheritance diagram for IdObject:

Callsite CNode Group Location NamedObject RmaWindow Topology MpiComm Machine Metric Node Process Region Thread MpiWindow Cartesian

List of all members.

Public Member Functions

Get & set object identifier
ident_t get_id () const
void set_id (ident_t id)
Comparison operators
bool operator< (const IdObject &rhs) const
bool operator> (const IdObject &rhs) const

Protected Member Functions

Constructors & destructor
 IdObject (ident_t id)
virtual ~IdObject ()

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &stream, const IdObject &item)


Detailed Description

The class IdObject serves as a base class for all entities that have a numerical identifier. The meaning of this ID, however, is defined by the individual derived classes.

The IdObject class provides the basic functionality to get and set the object identifier. In addition, instances can be compared based on their ID (equivalence test).


Constructor & Destructor Documentation

IdObject ( ident_t  id  )  [protected]

Creates a new instance and sets its identifier to the given id.

Parameters:
id Numerical identifier

~IdObject (  )  [protected, virtual]

Destructor. Destroys the instance.


Member Function Documentation

ident_t get_id (  )  const

Returns the object's numerical identifier.

Returns:
Numerical identifier

bool operator< ( const IdObject rhs  )  const

Returns true, if the instance's numerical identifier is less than the ID of the given object rhs. Returns false otherwise.

This comparison only makes sense if the two objects are of the same type, e.g., both objects are instances of the class Process. However, this is not checked at run-time.

Returns:
True, if get_id() < rhs.get_id()

bool operator> ( const IdObject rhs  )  const

Returns true, if the instance's numerical identifier is greater than the ID of the given object rhs. Returns false otherwise.

This comparison only makes sense if the two objects are of the same type, e.g., both objects are instances of the class Process. However, this is not checked at run-time.

Returns:
True, if get_id() > rhs.get_id()

void set_id ( ident_t  id  ) 

Sets (i.e., overwrites) the object's numerical identifier with the given id.

Parameters:
id New identifier


Friends And Related Function Documentation

ostream & operator<< ( std::ostream &  stream,
const IdObject item 
) [related]

Writes the numerical identifier of the given IdObject instance item to the output stream stream.

Parameters:
stream Output stream
item IdObject instance
Returns:
Output stream


SCALASCA    Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre