Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

RNReplicaNet::DatabaseManager< T > Class Template Reference

#include <DatabaseManager.h>

List of all members.

Public Member Functions

 DatabaseManager ()
virtual ~DatabaseManager ()
T * AddItem (T *item)
T * AddItemHead (T *item)
void RemoveItem (T *item)
void RemoveItem (void)
void BeginIterate (void)
void EndIterate (void)
T * Iterate (void)
T * FindItem (void *keyData)
int Tidy (void)
void SetEnableFastFind (bool enable=false)
void SetHashFromDataFunc (t_HashFromDataFunc *pfunc)
void SetHashFromKeyFunc (t_HashFromKeyFunc *pfunc)
void SetCompareDataWithKeyFunc (t_CompareDataWithKeyFunc *pfunc)


Detailed Description

template<class T>
class RNReplicaNet::DatabaseManager< T >

DatabaseManager is a template class for handling classes in an organised and quick database


Constructor & Destructor Documentation

template<class T>
RNReplicaNet::DatabaseManager< T >::DatabaseManager  )  [inline]
 

The ctor performs some basic initialisation

template<class T>
virtual RNReplicaNet::DatabaseManager< T >::~DatabaseManager  )  [inline, virtual]
 

The dtor makes sure everything is tidy


Member Function Documentation

template<class T>
T* RNReplicaNet::DatabaseManager< T >::AddItem T *  item  )  [inline]
 

Adds an item pointer 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

template<class T>
void RNReplicaNet::DatabaseManager< T >::BeginIterate void   )  [inline]
 

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

template<class T>
void RNReplicaNet::DatabaseManager< T >::EndIterate void   )  [inline]
 

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

template<class T>
T* RNReplicaNet::DatabaseManager< T >::FindItem void *  keyData  )  [inline]
 

This finds an item using the t_CompareDataWithKeyFunc as a callback. If the fast find algorithm is used then the t_HashFromKeyFunc is also used

Parameters:
keyData a pointer to key data to search for

template<class T>
T* RNReplicaNet::DatabaseManager< T >::Iterate void   )  [inline]
 

Iterates through the items in the list

Returns:
returns the next item pointer in the list or returns NULL for the end of the list

template<class T>
void RNReplicaNet::DatabaseManager< T >::RemoveItem void   )  [inline]
 

Removes the current iterated item but does not free the item as this is left to the user to do

template<class T>
void RNReplicaNet::DatabaseManager< T >::RemoveItem T *  item  )  [inline]
 

Removes an item pointer 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

template<class T>
void RNReplicaNet::DatabaseManager< T >::SetEnableFastFind bool  enable = false  )  [inline]
 

A speed enhancement for the database is to turn on the fast find algorithm. This algorithm uses several data hashing functions defined by the user that are then used to index the data.

Parameters:
enable set this to be true to enable the fast indexing algorithm. The default is false


The documentation for this class was generated from the following file:
Generated on Sun Oct 30 01:12:31 2005 for Platform by  doxygen 1.4.1