DatabaseManager 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

DatabaseManager (  )  [inline]

The ctor performs some basic initialisation

virtual ~DatabaseManager (  )  [inline, virtual]

The dtor makes sure everything is tidy


Member Function Documentation

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

void 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

void RemoveItem ( void   )  [inline]

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

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 ( 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

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

void 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


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