PPL Logo

CkHashtableLayout Class Reference

Describes the in-memory layout of a hashtable entry. More...

#include <ckhashtable.h>

Collaboration diagram for CkHashtableLayout:

Collaboration graph
[legend]

Public Member Functions

 CkHashtableLayout (int keySize, int emptyOffset, int objectOffset, int objectSize, int entryLength)
int entrySize (void) const
int keySize (void) const
int objectSize (void) const
char * getKey (char *entry) const
 Given an entry pointer, return a pointer to the key.
char * getObject (char *entry) const
 Given an entry pointer, return a pointer to the object.
char isEmpty (char *entry) const
 Is this entry empty?
void empty (char *entry) const
 Mark this entry as empty.
void fill (char *entry) const
 Mark this entry as full.
char * nextEntry (char *entry) const
 Move to the next entry.
char * entryFromKey (char *key) const
 Get entry pointer from key pointer.
char * entryFromObject (char *obj) const
 Get entry pointer from object pointer.

Private Attributes

int size
 Size of entire table entry, at least ks+os.
int ks
 Key byte size (offset is always zero).
int po
 "empty bit" offset (size is always 1)
int oo
int os
 Object byte offset and size.

Detailed Description

Describes the in-memory layout of a hashtable entry.

Nobody should ever use this class directly; use CkHashtableT or CkHashtableTslow instead.

"key" is a user-defined type, used as the unique object identifier. The key is assumed to begin at the start of the entry. "empty" is a character, set to 1 if this entry in the table is unused, zero otherwise; the "empty" field must not overlap either of the other fields. "object" is the thing the table stores; it is of a user-defined type and may overlap "key".

| key | empty | gap? | object | gap? | == | <------- hashtable entry --------> |

Definition at line 151 of file ckhashtable.h.


Constructor & Destructor Documentation

CkHashtableLayout::CkHashtableLayout ( int  keySize,
int  emptyOffset,
int  objectOffset,
int  objectSize,
int  entryLength 
) [inline]

Definition at line 157 of file ckhashtable.h.


Member Function Documentation

int CkHashtableLayout::entrySize ( void   )  const [inline]

Definition at line 165 of file ckhashtable.h.

References size.

Referenced by CkHashtable::buildTable(), CkHashtableIterator::entry(), CkHashtable::entry(), and CkHashtable::rehash().

Here is the caller graph for this function:

int CkHashtableLayout::keySize ( void   )  const [inline]

Definition at line 166 of file ckhashtable.h.

References ks.

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

Here is the caller graph for this function:

int CkHashtableLayout::objectSize ( void   )  const [inline]

Definition at line 167 of file ckhashtable.h.

References os.

char* CkHashtableLayout::getKey ( char *  entry  )  const [inline]

Given an entry pointer, return a pointer to the key.

Definition at line 171 of file ckhashtable.h.

Referenced by CkHashtable::findEntry(), CkHashtable::findKey(), CkHashtableIterator::next(), CkHashtable::put(), CkHashtable::rehash(), and CkHashtable::remove().

Here is the caller graph for this function:

char* CkHashtableLayout::getObject ( char *  entry  )  const [inline]

Given an entry pointer, return a pointer to the object.

Definition at line 173 of file ckhashtable.h.

References oo.

Referenced by CkHashtableT< intdual, int >::get(), CkHashtable::get(), CkHashtableT< intdual, int >::getPointer(), CkHashtableT< intdual, int >::getRef(), CkHashtableIterator::next(), and CkHashtable::put().

Here is the caller graph for this function:

char CkHashtableLayout::isEmpty ( char *  entry  )  const [inline]

void CkHashtableLayout::empty ( char *  entry  )  const [inline]

Mark this entry as empty.

Definition at line 178 of file ckhashtable.h.

References po.

Referenced by CkHashtable::buildTable(), CkHashtable::empty(), and CkHashtable::remove().

Here is the caller graph for this function:

void CkHashtableLayout::fill ( char *  entry  )  const [inline]

Mark this entry as full.

Definition at line 180 of file ckhashtable.h.

References po.

Referenced by CkHashtable::put().

Here is the caller graph for this function:

char* CkHashtableLayout::nextEntry ( char *  entry  )  const [inline]

Move to the next entry.

Definition at line 183 of file ckhashtable.h.

References size.

char* CkHashtableLayout::entryFromKey ( char *  key  )  const [inline]

Get entry pointer from key pointer.

Definition at line 186 of file ckhashtable.h.

Referenced by CkHashtable::remove().

Here is the caller graph for this function:

char* CkHashtableLayout::entryFromObject ( char *  obj  )  const [inline]

Get entry pointer from object pointer.

Definition at line 189 of file ckhashtable.h.

References oo.


Field Documentation

Size of entire table entry, at least ks+os.

Definition at line 152 of file ckhashtable.h.

Referenced by entrySize(), and nextEntry().

Key byte size (offset is always zero).

Definition at line 153 of file ckhashtable.h.

Referenced by keySize().

"empty bit" offset (size is always 1)

Definition at line 154 of file ckhashtable.h.

Referenced by empty(), fill(), and isEmpty().

Definition at line 155 of file ckhashtable.h.

Referenced by entryFromObject(), and getObject().

Object byte offset and size.

Definition at line 155 of file ckhashtable.h.

Referenced by objectSize().


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

Generated on Mon Sep 21 08:20:06 2020 for Charm++ by  doxygen 1.5.5