Urho3D
|
Hash set/map base class. More...
#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Container/HashBase.h>
Public Member Functions | |
HashBase () | |
Construct. | |
void | Swap (HashBase &rhs) |
Swap with another hash set or map. | |
i32 | Size () const |
Return number of elements. | |
i32 | NumBuckets () const |
Return number of buckets. | |
bool | Empty () const |
Return whether has no elements. | |
Static Public Attributes | |
static constexpr i32 | MIN_BUCKETS = 8 |
Initial amount of buckets. | |
static constexpr i32 | MAX_LOAD_FACTOR = 4 |
Maximum load factor. | |
Protected Member Functions | |
void | AllocateBuckets (i32 size, i32 numBuckets) |
Allocate bucket head pointers + room for size and bucket count variables. | |
void | ResetPtrs () |
Reset bucket head pointers. | |
void | SetSize (i32 size) |
Set new size. | |
HashNodeBase ** | Ptrs () const |
Return bucket head pointers. | |
Protected Attributes | |
HashNodeBase * | head_ |
List head node pointer. | |
HashNodeBase * | tail_ |
List tail node pointer. | |
HashNodeBase ** | ptrs_ |
Bucket head pointers. | |
AllocatorBlock * | allocator_ |
Node allocator. | |
Hash set/map base class.
Note that to prevent extra memory use due to vtable pointer, HashBase intentionally does not declare a virtual destructor and therefore HashBase pointers should never be used.