#include <DatabaseManager.h>
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) |
| DatabaseManager | ( | ) | [inline] |
The ctor performs some basic initialisation
| virtual ~DatabaseManager | ( | ) | [inline, virtual] |
The dtor makes sure everything is tidy
| 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
| 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
| 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
| 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
| 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.
| enable | set this to be true to enable the fast indexing algorithm. The default is false |
1.5.3