#include <ckhashtable.h>
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, int *existing=NULL) |
void * | get (const void *key) const |
int | remove (const void *key) |
void | empty (void) |
int | numObjects (void) const |
CkHashtableIterator * | iterator (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 &) |
Users should probably use CkHashtableT or CkHashtableTslow instead of calling this class directly.
Definition at line 197 of file ckhashtable.h.
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 | ( | ) |
void CkHashtable::operator= | ( | const CkHashtable & | ) | [private] |
Definition at line 215 of file ckhashtable.h.
References len.
Referenced by findEntry(), findKey(), CkHashtableT< intdual, int >::get(), CkHashtableT< intdual, int >::getPointer(), CkHashtableT< intdual, int >::getRef(), and remove().
char* CkHashtable::entry | ( | int | i | ) | const [inline, protected] |
Definition at line 218 of file ckhashtable.h.
References CkHashtableLayout::entrySize(), layout, and table.
Referenced by buildTable(), empty(), findEntry(), findKey(), CkHashtableT< intdual, int >::get(), CkHashtableT< intdual, int >::getPointer(), CkHashtableT< intdual, 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(), int, 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, src, and table.
Referenced by put().
void * CkHashtable::put | ( | const void * | key, | |
int * | existing = NULL | |||
) |
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< intdual, int >::put().
void* CkHashtable::get | ( | const void * | key | ) | const [inline] |
Definition at line 244 of file ckhashtable.h.
References findKey(), CkHashtableLayout::getObject(), key, and layout.
Referenced by CkHashtableTslow< intdual, int >::get(), and CkHashtableTslow< intdual, int >::getRef().
int CkHashtable::remove | ( | const void * | key | ) |
Definition at line 204 of file ckhashtable.C.
References dest, CkHashtableLayout::empty(), entry(), CkHashtableLayout::entryFromKey(), findEntry(), findKey(), CkHashtableLayout::getKey(), inc(), CkHashtableLayout::isEmpty(), layout, nObj, and src.
Referenced by CkHashtableTslow< intdual, 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< intdual, int >::getLayout(), and CkCacheArrayCounter::reset().
int CkHashtable::numObjects | ( | void | ) | const [inline] |
Definition at line 257 of file ckhashtable.h.
References nObj.
Referenced by ChareMlogData::pup().
CkHashtableIterator * CkHashtable::iterator | ( | void | ) |
Definition at line 239 of file ckhashtable.C.
References layout, len, and table.
Referenced by tupleTable::beginLookup(), CollisionAggregator::compact(), fillTicketForChare(), CpdList_introspect::getLength(), CkHashtableT< intdual, int >::pup(), CpdList_introspect::pup(), ChareMlogData::pup(), LV3D_Universe_Table::render(), CollisionAggregator::send(), IDXL_Map::~IDXL_Map(), and LockRegion::~LockRegion().
int CkHashtable::len [protected] |
Definition at line 202 of file ckhashtable.h.
Referenced by buildTable(), empty(), findEntry(), findKey(), CkHashtableT< intdual, int >::get(), CkHashtableT< intdual, int >::getPointer(), CkHashtableT< intdual, int >::getRef(), inc(), iterator(), put(), rehash(), and ~CkHashtable().
CkHashtableLayout CkHashtable::layout [protected] |
Definition at line 203 of file ckhashtable.h.
Referenced by buildTable(), empty(), entry(), findEntry(), findKey(), CkHashtableT< intdual, int >::get(), get(), CkHashtableT< intdual, int >::getPointer(), CkHashtableT< intdual, int >::getRef(), iterator(), put(), rehash(), and remove().
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().
int CkHashtable::resizeAt [protected] |
CkHashFunction CkHashtable::hash [protected] |
Definition at line 208 of file ckhashtable.h.
Referenced by CkHashtable(), findEntry(), and findKey().
CkHashCompare CkHashtable::compare [protected] |
Definition at line 209 of file ckhashtable.h.
Referenced by CkHashtable(), findEntry(), and findKey().
float CkHashtable::loadFactor [protected] |