RegistryManagerMap Class Template Reference

#include <RegistryManagerMap.h>

Inheritance diagram for RegistryManagerMap:

Inheritance graph
[legend]

List of all members.

Public Types

enum  Direction { kForward = 0, kBackward, kUndefined }

Public Member Functions

 RegistryManagerMap ()
virtual ~RegistryManagerMap ()
bool AddItem (const I &index, const T *item)
T * FindItem (const I &index)
T * FindItemNoIterator (const I &index)
bool RemoveItem (const I &index)
void RemoveItem (void)
void BeginIterate (void)
void EndIterate (void)
T * Iterate (I *index=0)
bool IsEmpty (void)
bool IsEmpty (void) const


Detailed Description

template<class I, class T, class C = std::less<I>>
class RNReplicaNet::RegistryManagerMap< I, T, C >

RegistryManager is a template class for handling classes in organised maps

Constructor & Destructor Documentation

RegistryManagerMap (  )  [inline]

The ctor performs some basic initialisation

virtual ~RegistryManagerMap (  )  [inline, virtual]

The dtor makes sure everything is tidy


Member Function Documentation

bool AddItem ( const I &  index,
const T *  item 
) [inline]

Adds an item to the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

T* FindItem ( const I &  index  )  [inline]

Finds an item using the index and if found also sets the current iterator to the item in the map. The direction of the iterator is set to be kUndefined.

Parameters:
index The index to use.
Returns:
The pointer to T corresponding to the index or null if the index was not found.

T* FindItemNoIterator ( const I &  index  )  [inline]

Finds an item using the index. The current iterator is not set.

Parameters:
index The index to use.
Returns:
The pointer to T corresponding to the index or null if the index was not found.

bool RemoveItem ( const I &  index  )  [inline]

Removes an item from the list but does not free the item as this is left to the user to do

Parameters:
item the item pointer to remove
Returns:
True indicates the index was in the map. False indicates the index was not in the map.

void RemoveItem ( void   )  [inline]

Removes the item at the current iterator.

void BeginIterate ( void   )  [inline]

Starts the iteration of the items in the list from the start and works forwards

void EndIterate ( void   )  [inline]

Starts the iteration of the items in the list from the end and works backwards

T* Iterate ( I *  index = 0  )  [inline]

Iterates through the items in the list

Parameters:
index Allows the value of the index to be read. The default is null indicating the index is not returned.
Returns:
returns the next item pointer in the list or returns NULL for the end of the list

bool IsEmpty ( void   )  [inline]

Returns true if the map is empty


Generated on Sat Jun 28 22:02:24 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3