|
HDK
|
#include <UT_CollapseIDs.h>
Public Member Functions | |
| UT_CollapseIDs () | |
| bool | contains (const S &id) const |
| Returns true if the id maps to something already. More... | |
| T | operator[] (const S &id) |
| void | freeId (const S &id) |
Protected Member Functions | |
| SYS_FORCE_INLINE void | returnValue (const T &value) |
| SYS_FORCE_INLINE T | getFreeValue () |
| SYS_FORCE_INLINE void | decrementFreeStart () |
Protected Attributes | |
| UT_Set< T > | myFreeList |
| T | myFreeStart |
| All values equal to or greater than this value are free. More... | |
| UT_Map< S, T > | myMapping |
This class is designed to map integral values to integral values. For each newly-added mapping, the mapped value will be a unique integer that's guaranteed to be small.
Definition at line 28 of file UT_CollapseIDs.h.
|
inline |
Definition at line 31 of file UT_CollapseIDs.h.
|
inline |
Returns true if the id maps to something already.
Definition at line 34 of file UT_CollapseIDs.h.
|
inlineprotected |
Decreases myFreeStart by 1 and also sweeps the free list to remove any entries that can be merged with it.
Definition at line 107 of file UT_CollapseIDs.h.
|
inline |
This call removes the mapping from id, marking whatever it was mapped to as an available value.
Definition at line 58 of file UT_CollapseIDs.h.
|
inlineprotected |
Returns a free value, with some effort put into ensuring that the smallest free value is returned.
Definition at line 81 of file UT_CollapseIDs.h.
|
inline |
Returns the value that id maps to. If the mapping doesn't yet exist, a non-clashing one is registered.
Definition at line 41 of file UT_CollapseIDs.h.
|
inlineprotected |
The given value is returned as free, making it available for subsequent requests for a free value.
Definition at line 70 of file UT_CollapseIDs.h.
|
protected |
Set of free values; a value in this list is guaranteed to be free, and no value equal to or greater than myFreeStart-1 is in this set.
Definition at line 126 of file UT_CollapseIDs.h.
|
protected |
All values equal to or greater than this value are free.
Definition at line 128 of file UT_CollapseIDs.h.
The actual mappings. This container ensures that no two myMapping[x] values will be the same.
Definition at line 131 of file UT_CollapseIDs.h.