#include <RegistryManagerMap.h>
|
enum | Direction { kForward =0,
kBackward,
kUndefined
} |
|
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
The ctor performs some basic initialisation
The dtor makes sure everything is tidy
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 |
void BeginIterate |
( |
void |
| ) |
|
|
inline |
Starts the iteration of the items in the list from the start and works forwards
Clears the associated map. Does not free the items.
Starts the iteration of the items in the list from the end and works backwards
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
-
- 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
-
- Returns
- The pointer to T corresponding to the index or null if the index was not found.
Returns true if the map is empty
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 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.
Removes the item at the current iterator.