CkHashtable Class Reference

A resize-on-demand extensible hashtable. More...

#include <ckhashtable.h>

Inheritance diagram for CkHashtable:

Inheritance graph
[legend]
Collaboration diagram for CkHashtable:

Collaboration graph
[legend]

Public Member Functions

 CkHashtable (const CkHashtableLayout &layout_, int initLen=5, float NloadFactor=0.5, CkHashFunction hash=CkHashFunction_default, CkHashCompare compare=CkHashCompare_default)
 ~CkHashtable ()
void * put (const void *key)
void * get (const void *key) const
int remove (const void *key)
void empty (void)
int numObjects (void) const
CkHashtableIteratoriterator (void)

Protected Member Functions

int inc (int &i) const
char * entry (int i) const
char * findKey (const void *key) const
char * findEntry (const void *key) const
void buildTable (int newLen)
void rehash (int newLen)

Protected Attributes

int len
CkHashtableLayout layout
char * table
int nObj
int resizeAt
CkHashFunction hash
CkHashCompare compare
float loadFactor

Private Member Functions

 CkHashtable (const CkHashtable &)
void operator= (const CkHashtable &)

Detailed Description

A resize-on-demand extensible hashtable.

Users should probably use CkHashtableT or CkHashtableTslow instead of calling this class directly.

Definition at line 197 of file ckhashtable.h.


Constructor & Destructor Documentation

CkHashtable::CkHashtable ( const CkHashtable  )  [private]

CkHashtable::CkHashtable ( const CkHashtableLayout layout_,
int  initLen = 5,
float  NloadFactor = 0.5,
CkHashFunction  hash = CkHashFunction_default,
CkHashCompare  compare = CkHashCompare_default 
)

Definition at line 142 of file ckhashtable.C.

References buildTable(), compare, hash, loadFactor, and nObj.

CkHashtable::~CkHashtable (  ) 

Definition at line 156 of file ckhashtable.C.

References len, nObj, and table.


Member Function Documentation

void CkHashtable::operator= ( const CkHashtable  )  [private]

int CkHashtable::inc ( int i  )  const [inline, protected]

char* CkHashtable::entry ( int  i  )  const [inline, protected]

char * CkHashtable::findKey ( const void *  key  )  const [protected]

char * CkHashtable::findEntry ( const void *  key  )  const [protected]

void CkHashtable::buildTable ( int  newLen  )  [protected]

void CkHashtable::rehash ( int  newLen  )  [protected]

void * CkHashtable::put ( const void *  key  ) 

void* CkHashtable::get ( const void *  key  )  const [inline]

int CkHashtable::remove ( const void *  key  ) 

void CkHashtable::empty ( void   ) 

int CkHashtable::numObjects ( void   )  const [inline]

CkHashtableIterator * CkHashtable::iterator ( void   ) 


Field Documentation

int CkHashtable::len [protected]

char* CkHashtable::table [protected]

Definition at line 204 of file ckhashtable.h.

Referenced by buildTable(), entry(), iterator(), rehash(), and ~CkHashtable().

int CkHashtable::nObj [protected]

Definition at line 206 of file ckhashtable.h.

Referenced by CkHashtable(), empty(), numObjects(), put(), remove(), and ~CkHashtable().

Definition at line 207 of file ckhashtable.h.

Referenced by buildTable(), and put().

Definition at line 208 of file ckhashtable.h.

Referenced by CkHashtable(), findEntry(), and findKey().

Definition at line 209 of file ckhashtable.h.

Referenced by CkHashtable(), findEntry(), and findKey().

float CkHashtable::loadFactor [protected]

Definition at line 211 of file ckhashtable.h.

Referenced by buildTable(), and CkHashtable().


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

Generated on Mon Nov 23 07:56:56 2009 for Charm++ by  doxygen 1.5.5