Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
hashbase< H, E, K, T > Struct Template Reference

#include <cube_hash.hpp>

Classes

struct  chain
 
struct  chainchunk
 

Public Types

enum  { CHUNKSIZE = 64 }
 
enum  { DEFAULTSIZE = 1<<10 }
 
typedef E elemtype
 
typedef K keytype
 
typedef T datatype
 

Public Member Functions

 hashbase (int size=DEFAULTSIZE)
 
 ~hashbase ()
 
chaininsert (uint h)
 
template<class U >
T & insert (uint h, const U &key)
 
template<class U >
T * access (const U &key)
 
template<class U , class V >
T & access (const U &key, const V &elem)
 
template<class U >
T & operator[] (const U &key)
 
template<class U >
T & find (const U &key, T &notfound)
 
template<class U >
const T & find (const U &key, const T &notfound)
 
template<class U >
bool remove (const U &key)
 
void deletechunks ()
 
void clear ()
 

Static Public Member Functions

static chainenumnext (void *i)
 
static K & enumkey (void *i)
 
static T & enumdata (void *i)
 

Public Attributes

int size
 
int numelems
 
chain ** chains
 
chainchunkchunks
 
chainunused
 

Class Documentation

struct hashbase::chain

template<class H, class E, class K, class T>
struct hashbase< H, E, K, T >::chain

Class Members
E elem
chain * next
struct hashbase::chainchunk

template<class H, class E, class K, class T>
struct hashbase< H, E, K, T >::chainchunk

Class Members
chain chains[CHUNKSIZE]
chainchunk * next

Member Typedef Documentation

template<class H, class E, class K, class T>
typedef T hashbase< H, E, K, T >::datatype
template<class H, class E, class K, class T>
typedef E hashbase< H, E, K, T >::elemtype
template<class H, class E, class K, class T>
typedef K hashbase< H, E, K, T >::keytype

Member Enumeration Documentation

template<class H, class E, class K, class T>
anonymous enum
Enumerator
CHUNKSIZE 
template<class H, class E, class K, class T>
anonymous enum
Enumerator
DEFAULTSIZE 

Constructor & Destructor Documentation

template<class H, class E, class K, class T>
hashbase< H, E, K, T >::hashbase ( int  size = DEFAULTSIZE)
inline
template<class H, class E, class K, class T>
hashbase< H, E, K, T >::~hashbase ( )
inline

Member Function Documentation

template<class H, class E, class K, class T>
template<class U >
T* hashbase< H, E, K, T >::access ( const U &  key)
inline
template<class H, class E, class K, class T>
template<class U , class V >
T& hashbase< H, E, K, T >::access ( const U &  key,
const V &  elem 
)
inline
template<class H, class E, class K, class T>
void hashbase< H, E, K, T >::clear ( )
inline
template<class H, class E, class K, class T>
void hashbase< H, E, K, T >::deletechunks ( )
inline
template<class H, class E, class K, class T>
static T& hashbase< H, E, K, T >::enumdata ( void i)
inlinestatic
template<class H, class E, class K, class T>
static K& hashbase< H, E, K, T >::enumkey ( void i)
inlinestatic
template<class H, class E, class K, class T>
static chain* hashbase< H, E, K, T >::enumnext ( void i)
inlinestatic
template<class H, class E, class K, class T>
template<class U >
T& hashbase< H, E, K, T >::find ( const U &  key,
T &  notfound 
)
inline
template<class H, class E, class K, class T>
template<class U >
const T& hashbase< H, E, K, T >::find ( const U &  key,
const T &  notfound 
)
inline
template<class H, class E, class K, class T>
chain* hashbase< H, E, K, T >::insert ( uint  h)
inline
template<class H, class E, class K, class T>
template<class U >
T& hashbase< H, E, K, T >::insert ( uint  h,
const U &  key 
)
inline
template<class H, class E, class K, class T>
template<class U >
T& hashbase< H, E, K, T >::operator[] ( const U &  key)
inline
template<class H, class E, class K, class T>
template<class U >
bool hashbase< H, E, K, T >::remove ( const U &  key)
inline

Member Data Documentation

template<class H, class E, class K, class T>
chain** hashbase< H, E, K, T >::chains
template<class H, class E, class K, class T>
chainchunk* hashbase< H, E, K, T >::chunks
template<class H, class E, class K, class T>
int hashbase< H, E, K, T >::numelems
template<class H, class E, class K, class T>
int hashbase< H, E, K, T >::size
template<class H, class E, class K, class T>
chain* hashbase< H, E, K, T >::unused

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