HashMapAllocator< GENERAL_ALLOCATOR, BLOCK_ALLOCATOR > Class Template Reference

#include <hashmap.h>

Detailed Description

template<typename GENERAL_ALLOCATOR, typename BLOCK_ALLOCATOR>
class maxon::HashMapAllocator< GENERAL_ALLOCATOR, BLOCK_ALLOCATOR >

Special case of general and entry allocator being different (usually for performance critical fixed/limited size maps).

Public Types

using EntryAllocator = BLOCK_ALLOCATOR
 

Public Member Functions

 HashMapAllocator ()=default
 
template<typename A >
 HashMapAllocator (A &&arg)
 
void * AllocBuckets (Int size, MAXON_SOURCE_LOCATION_DECLARATION)
 
void FreeBuckets (void *buckets)
 
template<typename ENTRY >
void * AllocEntry (Int size)
 
void FreeEntry (const void *entry)
 
template<typename ENTRY >
Bool DeleteAllEntries ()
 
const EntryAllocator & GetEntryAllocator () const
 
EntryAllocator & GetEntryAllocator ()
 

Static Public Member Functions

static constexpr Bool SupportsEntryIterator ()
 

Static Public Attributes

static constexpr Bool HAS_ARRAY_ALLOCATOR
 

Private Attributes

GENERAL_ALLOCATOR _bucketAllocator
 
BLOCK_ALLOCATOR _entryAllocator
 

Member Typedef Documentation

◆ EntryAllocator

using EntryAllocator = BLOCK_ALLOCATOR

Constructor & Destructor Documentation

◆ HashMapAllocator() [1/2]

HashMapAllocator ( )
default

◆ HashMapAllocator() [2/2]

HashMapAllocator ( A &&  arg)
explicit

Member Function Documentation

◆ AllocBuckets()

void* AllocBuckets ( Int  size,
MAXON_SOURCE_LOCATION_DECLARATION   
)

◆ FreeBuckets()

void FreeBuckets ( void *  buckets)

◆ AllocEntry()

void* AllocEntry ( Int  size)

◆ FreeEntry()

void FreeEntry ( const void *  entry)

◆ DeleteAllEntries()

Bool DeleteAllEntries ( )

◆ SupportsEntryIterator()

static constexpr Bool SupportsEntryIterator ( )
staticconstexpr

◆ GetEntryAllocator() [1/2]

const EntryAllocator& GetEntryAllocator ( ) const

◆ GetEntryAllocator() [2/2]

EntryAllocator& GetEntryAllocator ( )

Member Data Documentation

◆ _bucketAllocator

GENERAL_ALLOCATOR _bucketAllocator
private

◆ _entryAllocator

BLOCK_ALLOCATOR _entryAllocator
private

◆ HAS_ARRAY_ALLOCATOR

constexpr Bool HAS_ARRAY_ALLOCATOR
staticconstexpr