Utility to assign unique non-zero IDs to objects. Thread-safe.
More...
#include <Urho3D/Container/IndexAllocator.h>
|
|
unsigned | GetNextFreeIndex () const |
| | Return upper bound of allocated indices.
|
| |
|
unsigned | GetSize () const |
| | Return number of currently allocated indices.
|
| |
|
unsigned | Allocate () |
| | Allocate index.
|
| |
|
void | Release (unsigned index) |
| | Release index. Index should be previously returned from Allocate and not released yet.
|
| |
|
void | Shrink () |
| | Shrink collection to minimum possible size preserving currently allocated indices.
|
| |
|
void | Clear () |
| | Reset to default state.
|
| |
|
|
MutexType | mutex_ |
| | Mutex that protects list and index.
|
| |
|
std::atomic_uint32_t | nextIndex_ { 1 } |
| | Next unused index.
|
| |
|
ea::vector< unsigned > | unusedIndices_ |
| | Unused indices.
|
| |
template<class T = DummyMutex>
class Urho3D::IndexAllocator< T >
Utility to assign unique non-zero IDs to objects. Thread-safe.
The documentation for this class was generated from the following file:
- Urho3D/Container/IndexAllocator.h