Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
HashManager< K, H, A > Class Template Reference

#include <elm/data/Manager.h>

Public Types

typedef H hash_t
 
typedef A alloc_t
 

Public Member Functions

 HashManager (void)
 
 HashManager (const H &h, A &a=DefaultAllocator::DEFAULT)
 
bool isEqual (const K &k1, const K &k2) const
 
t::hash computeHash (const K &k) const
 
template<class T >
voidallocate ()
 
void free (void *p)
 

Static Public Member Functions

static HashManager< K, H, A > & def ()
 

Public Attributes

hash
 
A & alloc
 

Detailed Description

template<class K, class H = HashKey<K>, class A = DefaultAllocator>
class elm::HashManager< K, H, A >

This class is used to control the work of container classes (see Data Structures) supporting lookup and sorting based on key hashing. It embeds two control objects:

  • hash of type H – used to test perform hashing,
  • alloc – for memory allocation.

It is easily customized by changing the type parameters and by passing objects to the constructor.

Parameters
KType of data keys.
HHash class (default to HashKey<K>).
AAllocation class (default to DefaultAllocator).

Member Typedef Documentation

◆ alloc_t

typedef A alloc_t

◆ hash_t

typedef H hash_t

Constructor & Destructor Documentation

◆ HashManager() [1/2]

HashManager ( void  )
inline

◆ HashManager() [2/2]

HashManager ( const H &  h,
A &  a = DefaultAllocator::DEFAULT 
)
inline

Member Function Documentation

◆ allocate()

void* allocate ( )
inline

◆ computeHash()

t::hash computeHash ( const K &  k) const
inline

◆ def()

static HashManager<K, H, A>& def ( )
inlinestatic

◆ free()

void free ( void p)
inline

◆ isEqual()

bool isEqual ( const K &  k1,
const K &  k2 
) const
inline

Member Data Documentation

◆ alloc

◆ hash


The documentation for this class was generated from the following file: