ABA_IDMAP< Type > Class Template Reference

class ABA_IDMAP<Type> implements a map between elements of ABA_ID and pointers to objects of the class Type. More...

#include <idmap.h>

Inheritance diagram for ABA_IDMAP< Type >:

ABA_ABACUSROOT List of all members.

Public Member Functions

 ABA_IDMAP (ABA_MASTER *master, int size, int index)
 ~ABA_IDMAP ()
 The destructor.
Type * find (const ABA_ID &id)
void insert (const ABA_ID &id, const Type *obj)
void insertWithNewId (ABA_ID &id, const Type *obj)
void insertAlias (const ABA_ID &id, const ABA_ID &aliasId)
int remove (const ABA_ID &id)
unsigned long sequence () const
int proc () const
int index () const

Private Attributes

ABA_MASTERmaster_
ABA_HASH< ABA_ID, const Type * > map_
unsigned long sequence_
int proc_
int index_
ACE_Thread_Mutex mp_

Friends

ostream & operator<< (ostream &out, const ABA_IDMAP< Type > &idmap)

Detailed Description

template<class Type>
class ABA_IDMAP< Type >

class ABA_IDMAP<Type> implements a map between elements of ABA_ID and pointers to objects of the class Type.

Definition at line 60 of file idmap.h.


Constructor & Destructor Documentation

template<class Type>
ABA_IDMAP< Type >::ABA_IDMAP ( ABA_MASTER master,
int  size,
int  index 
)

The constructor.

Parameters:
master A pointer to the corresponding master object.
size The size of the hashtable used by the map.
pool The index of the pool, if the ABA_ID identifies a constraint/variable.

template<class Type>
ABA_IDMAP< Type >::~ABA_IDMAP (  ) 

The destructor.


Member Function Documentation

template<class Type>
Type* ABA_IDMAP< Type >::find ( const ABA_ID id  ) 

Looks up an object in the map by its ABA_ID.

Returns:
A pointer to the object with the given ABA_ID, or a 0-pointer if there is no such object.
Parameters:
id The ABA_ID of the object beeing looked up.

template<class Type>
void ABA_IDMAP< Type >::insert ( const ABA_ID id,
const Type *  obj 
)

Parameters:
id The identification of the object.
obj A pointer to the object beeing inserted.

template<class Type>
void ABA_IDMAP< Type >::insertWithNewId ( ABA_ID id,
const Type *  obj 
)

Inserts the object after having assigned a new ABA_ID to it.

The new ABA_ID consists of the processor number and a sequence number which is incremented each time this function is called.

Parameters:
id The new identification is assigned to id.
obj A pointer to the object beeing inserted.

template<class Type>
void ABA_IDMAP< Type >::insertAlias ( const ABA_ID id,
const ABA_ID aliasId 
)

template<class Type>
int ABA_IDMAP< Type >::remove ( const ABA_ID id  ) 

Returns:
0 If the ABA_ID was successfully removed.

1 If there is no such ABA_ID in the map.

Parameters:
id The identification beeing removed.

template<class Type>
unsigned long ABA_IDMAP< Type >::sequence (  )  const [inline]

Definition at line 144 of file idmap.h.

template<class Type>
int ABA_IDMAP< Type >::proc (  )  const [inline]

Definition at line 146 of file idmap.h.

template<class Type>
int ABA_IDMAP< Type >::index (  )  const [inline]

Definition at line 148 of file idmap.h.


Friends And Related Function Documentation

template<class Type>
ostream& operator<< ( ostream &  out,
const ABA_IDMAP< Type > &  idmap 
) [friend]

The output operator writes the ABA_IDMAP to the stream out.

Returns:
A reference to the output stream.
Parameters:
out The output stream.
idmap The ABA_IDMAP being output.


Member Data Documentation

template<class Type>
ABA_MASTER* ABA_IDMAP< Type >::master_ [private]

Definition at line 132 of file idmap.h.

template<class Type>
ABA_HASH<ABA_ID, const Type*> ABA_IDMAP< Type >::map_ [private]

Definition at line 133 of file idmap.h.

template<class Type>
unsigned long ABA_IDMAP< Type >::sequence_ [private]

Definition at line 134 of file idmap.h.

template<class Type>
int ABA_IDMAP< Type >::proc_ [private]

Definition at line 135 of file idmap.h.

template<class Type>
int ABA_IDMAP< Type >::index_ [private]

Definition at line 136 of file idmap.h.

template<class Type>
ACE_Thread_Mutex ABA_IDMAP< Type >::mp_ [private]

Definition at line 137 of file idmap.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:57 2007 for ABACUS by  doxygen 1.5.1