IBucketSet

Generic BucketSet base class

Constructors

this
this(IAllocator bucket_element_allocator, size_t n, float load_factor)

Constructor.

Members

Aliases

IAllocator
alias IAllocator = .IAllocator

Convenience type alias for subclasses.

Functions

clear
typeof(this) clear()

Removes all elements from all buckets.

clearBuckets
void clearBuckets(void[] val_init)

Removes all elements from all buckets.

clear_
typeof(this) clear_(void[] val_init)

Removes all elements from all buckets and sets the values to val_init if val_init is not empty.

length
size_t length()

Get the length of the buckets.

redistribute
typeof(this) redistribute(float load_factor)

Changes the number of buckets to the lowest power of 2 that results in a load factor of at least load_factor with the current number of elements.

setNumBuckets
typeof(this) setNumBuckets(uint exp2)

Changes the number of buckets to 2 ^ exp2.

Static functions

calcNumBucketsExp2
uint calcNumBucketsExp2(size_t n, float load_factor)

Calculates the lowest exponent of 2 so that a power of 2 with this exponent is at least n / load_factor.

Variables

bucket_element_allocator
IAllocator bucket_element_allocator;

Bucket element allocator.

bucket_info
BucketInfo bucket_info;

Map and and bucket statistics like the map length or the number of buckets.

Meta