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
void 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 177 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]

Definition at line 195 of file ckhashtable.h.

References len.

Referenced by findEntry(), findKey(), CkHashtableT< StrKey, int >::get(), CkHashtableT< StrKey, int >::getRef(), and remove().

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

Definition at line 198 of file ckhashtable.h.

References CkHashtableLayout::entrySize(), layout, and table.

Referenced by buildTable(), empty(), findEntry(), findKey(), CkHashtableT< StrKey, int >::get(), CkHashtableT< StrKey, int >::getRef(), put(), and remove().

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

Definition at line 77 of file ckhashtable.C.

References compare, entry(), CkHashtableLayout::getKey(), hash, inc(), CkHashtableLayout::isEmpty(), CkHashtableLayout::keySize(), layout, and len.

Referenced by get(), and remove().

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

Definition at line 94 of file ckhashtable.C.

References CmiAbort(), compare, entry(), CkHashtableLayout::getKey(), hash, inc(), CkHashtableLayout::isEmpty(), CkHashtableLayout::keySize(), layout, and len.

Referenced by put(), rehash(), and remove().

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

Definition at line 111 of file ckhashtable.C.

References CkHashtableLayout::empty(), entry(), CkHashtableLayout::entrySize(), layout, len, loadFactor, resizeAt, and table.

Referenced by CkHashtable(), and rehash().

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

Definition at line 121 of file ckhashtable.C.

References buildTable(), dest, CkHashtableLayout::entrySize(), findEntry(), CkHashtableLayout::getKey(), CkHashtableLayout::isEmpty(), layout, len, and table.

Referenced by put().

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

Definition at line 177 of file ckhashtable.C.

References CmiAbort(), entry(), CkHashtableLayout::fill(), findEntry(), CkHashtableLayout::getKey(), CkHashtableLayout::getObject(), CkHashtableLayout::isEmpty(), layout, len, nObj, primeLargerThan(), rehash(), and resizeAt.

Referenced by tupleTable::addTuple(), and CkHashtableTslow< StrKey, int >::put().

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

Definition at line 224 of file ckhashtable.h.

References findKey(), CkHashtableLayout::getObject(), and layout.

Referenced by tupleTable::addTuple(), CkHashtableTslow< StrKey, int >::get(), CkHashtableTslow< StrKey, int >::getRef(), tupleTable::lookupTuple(), and PUP_getRegEntry().

void CkHashtable::remove ( const void *  key  ) 

Definition at line 200 of file ckhashtable.C.

References dest, CkHashtableLayout::empty(), entry(), CkHashtableLayout::entryFromKey(), findEntry(), findKey(), CkHashtableLayout::getKey(), inc(), CkHashtableLayout::isEmpty(), layout, and nObj.

Referenced by CkHashtableTslow< StrKey, int >::remove().

void CkHashtable::empty ( void   ) 

Definition at line 165 of file ckhashtable.C.

References dest, CkHashtableLayout::empty(), entry(), layout, len, and nObj.

Referenced by CollisionAggregator::compact(), CkHashtableTslow< StrKey, int >::getLayout(), and CkCacheArrayCounter::reset().

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

Definition at line 236 of file ckhashtable.h.

References nObj.

Referenced by TraceProjections::getFuncNumber().

CkHashtableIterator * CkHashtable::iterator ( void   ) 

Definition at line 233 of file ckhashtable.C.

References layout, len, and table.

Referenced by tupleTable::beginLookup(), CollisionAggregator::compact(), CkLocMgr::flushAllRecs(), TraceProjections::getfuncIterator(), CpdList_introspect::getLength(), ComlibArrayListener::getLocalIndices(), CkLocMgr::iterate(), CharismaGraph::Partition(), CkHashtableT< StrKey, int >::pup(), CpdList_introspect::pup(), ComlibManager::receiveTable(), LV3D_Universe_Table::render(), CollisionAggregator::send(), CkLocMgr::springCleaning(), DirectMulticastStrategy::~DirectMulticastStrategy(), IDXL_Map::~IDXL_Map(), LockRegion::~LockRegion(), and RectMulticastStrategy::~RectMulticastStrategy().


Field Documentation

int CkHashtable::len [protected]

Definition at line 182 of file ckhashtable.h.

Referenced by buildTable(), empty(), findEntry(), findKey(), CkHashtableT< StrKey, int >::get(), CkHashtableT< StrKey, int >::getRef(), inc(), iterator(), put(), rehash(), and ~CkHashtable().

CkHashtableLayout CkHashtable::layout [protected]

Definition at line 183 of file ckhashtable.h.

Referenced by buildTable(), empty(), entry(), findEntry(), findKey(), get(), iterator(), put(), rehash(), and remove().

char* CkHashtable::table [protected]

Definition at line 184 of file ckhashtable.h.

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

int CkHashtable::nObj [protected]

Definition at line 186 of file ckhashtable.h.

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

int CkHashtable::resizeAt [protected]

Definition at line 187 of file ckhashtable.h.

Referenced by buildTable(), and put().

CkHashFunction CkHashtable::hash [protected]

Definition at line 188 of file ckhashtable.h.

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

CkHashCompare CkHashtable::compare [protected]

Definition at line 189 of file ckhashtable.h.

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

float CkHashtable::loadFactor [protected]

Definition at line 191 of file ckhashtable.h.

Referenced by buildTable(), and CkHashtable().


The documentation for this class was generated from the following files:
Generated on Sun Jun 29 13:30:41 2008 for Charm++ by  doxygen 1.5.1