PPL Logo

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, int *existing=NULL)
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.

Here is the call graph for this function:

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 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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 257 of file ckhashtable.h.

References nObj.

Referenced by ChareMlogData::pup().

Here is the caller graph for this function:

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().

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 Sep 21 08:20:03 2020 for Charm++ by  doxygen 1.5.5