|
Nebula
|
#include <idpool.h>
Public Member Functions | |
| IdPool () | |
| constructor | |
| IdPool (const uint max, const uint grow=512) | |
| constructor with maximum size | |
| ~IdPool () | |
| destructor | |
| uint | Alloc () |
| get new id | |
| void | Dealloc (uint id) |
| free id | |
| void | Reserve (uint numIds) |
| reserve ids | |
| uint | GetNumUsed () const |
| get number of active ids | |
| uint | GetNumFree () const |
| get number of free elements | |
| void | ForEachFree (const std::function< void(uint, uint)> fun, SizeT num) |
| iterate free indices | |
| void | Move (uint lhs, uint rhs) |
| frees up lhs and erases rhs | |
| const uint | GetGrow () const |
| get grow | |
Private Attributes | |
| Util::Array< uint > | free |
| uint | maxId |
| uint | grow |
|
inline |
constructor
|
inline |
destructor
|
inline |
get new id
|
inline |
free id
iterate free indices
|
inline |
get grow
|
inline |
get number of free elements
|
inline |
get number of active ids
|
inline |
reserve ids
|
private |
|
private |
|
private |