Nebula
|
This simple Id pool implements a set of free and used consecutive integers.
The pool can be configured to only release new Ids up to a certain maximum, after which it asserts.
Essentially, it allocates a certain amount of new Ids when needed (not following the Array method of doubling its size) and can recycle the indices for later. Unlike the IdGenerationPool, this one does not keep track of how many times an id has been reused, so use this with caution!
Maximum amount of bits produced by this system is 32.
Classes | |
class | Id |
This class implements some static helper functions to set high and low 32-bit integers, as well as a function to create a complete id from two of them. More... | |
class | IdAllocator |
An ID allocator associates an id with a slice in an N number of arrays. More... | |
class | IdAllocatorSafe |
class | IdGenerationPool |
Provides a system for creating array friendly id numbers with reuse and generations. More... | |
class | IdPool |
Typedefs | |
typedef uint64_t | Id64 |
typedef uint32_t | Id32 |
typedef uint32_t | Id24 |
typedef uint16_t | Id16 |
typedef uint8_t | Id8 |
Functions | |
static constexpr Id24 | Index (const Id32 id) |
static constexpr generation_t | Generation (const Id32 id) |
static Id32 | CreateId (const Id24 index, generation_t generation) |
Variables | |
static constexpr Id64 | InvalidId64 = 0xFFFFFFFFFFFFFFFF |
static constexpr Id32 | InvalidId32 = 0xFFFFFFFF |
static constexpr Id24 | InvalidId24 = 0x00FFFFFF |
static constexpr Id16 | InvalidId16 = 0xFFFF |
static constexpr Id8 | InvalidId8 = 0xFF |
typedef uint16_t Ids::Id16 |
typedef uint32_t Ids::Id24 |
typedef uint32_t Ids::Id32 |
typedef uint64_t Ids::Id64 |
typedef uint8_t Ids::Id8 |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |