This class will generate keep track of a pool of unique 32-bit ID's that can be used for distinct object instances. More...
#include <uidgenerator.h>
Public Types | |
typedef IDContainer::const_iterator | ConstIDIterator |
Const Iterator type for IDs generated and stored by this class. | |
typedef std::vector< IntervalType > | IDContainer |
Basic container type for IDs generated and stored by this class. | |
typedef IDContainer::iterator | IDIterator |
Iterator type for IDs generated and stored by this class. | |
typedef UInt32 | IDType |
Convenience type for the ID to be used. Should be some flavor of int. | |
typedef Interval< IDType > | IntervalType |
Convenience type for Intervals used by this class. | |
Public Member Functions | |
UIDGenerator () | |
Class constructor. | |
~UIDGenerator () | |
Class destructor. | |
IDType | GenerateID () |
Generates a new ID unique to the pool made by this generator. More... | |
Boole | IsIDUsed (const IDType ID) const |
Checks to see if an ID is in use. More... | |
Boole | ReleaseID (const IDType ID) |
Frees up an ID so that it can be reused. More... | |
Boole | ReserveID (const IDType ID) |
Adds a specific ID to the pool of used IDs. More... | |
void | Sort () |
Sorts the free IDs stored in this generator. | |
Protected Attributes | |
IDContainer | FreeIDs |
The container storing all IDs generated and in use by this generator. More... | |
This class will generate keep track of a pool of unique 32-bit ID's that can be used for distinct object instances.
Definition at line 53 of file uidgenerator.h.
UIDGenerator::IDType Mezzanine::UIDGenerator::GenerateID | ( | ) |
Generates a new ID unique to the pool made by this generator.
Definition at line 62 of file uidgenerator.cpp.
Checks to see if an ID is in use.
ID | The ID to check whether or not it is used. |
Definition at line 78 of file uidgenerator.cpp.
Frees up an ID so that it can be reused.
ID | The ID to be freed up for reuse. |
Definition at line 133 of file uidgenerator.cpp.
Adds a specific ID to the pool of used IDs.
ID | The ID to be reserved. |
Definition at line 89 of file uidgenerator.cpp.
|
protected |
The container storing all IDs generated and in use by this generator.
Definition at line 69 of file uidgenerator.h.