This class implements the collision resolution of the hashtable. It uses the simple chaining strategy. It's just a simple list of entries which having the same hash. If there are multiple entries they are searched by linear probing. More...

#include <hashtable.h>

Inheritance diagram for ChainEntry:
Collaboration diagram for ChainEntry:

List of all members.

Public Member Functions

 ChainEntry ()
ChainEntryfind (const UaNodeId &key, ChainEntry **ppPrevious)
void add (ChainEntry *pNewEntry)
void prepend (ChainEntry *pNewEntry)
ChainEntryremove (const UaNodeId &key, ChainEntry **ppNext)
virtual UaNodeId getKey () const =0
ChainEntrygetNext () const
virtual void setInvalid ()

Protected Member Functions

virtual ~ChainEntry ()

Protected Attributes

ChainEntrym_pNext
 Membervar.

Detailed Description

This class implements the collision resolution of the hashtable. It uses the simple chaining strategy. It's just a simple list of entries which having the same hash. If there are multiple entries they are searched by linear probing.

ChainEntry


Constructor & Destructor Documentation

ChainEntry::~ChainEntry (  ) [protected, virtual]

destruction

ChainEntry::ChainEntry (  )

construction


Member Function Documentation

void ChainEntry::add ( ChainEntry pNewEntry )

adds a new entry to the list.

Parameters:
pNewEntryPointer to the new entry.
ChainEntry * ChainEntry::find ( const UaNodeId key,
ChainEntry **  ppPrevious 
)

finds the right entry in the chain.

Parameters:
keyThe key identifying the entry.
ppPreviousReturns the pointer to the previous entry. Needed to change the linked list.
Returns:
the pointer to the found object or NULL if not found.
virtual UaNodeId ChainEntry::getKey (  ) const [pure virtual]

this returns the key of this entry. This method can be overwritten to optimize redundant information. The key doesn't need to be saved for every entry.

Implemented in UaNode.

ChainEntry* ChainEntry::getNext (  ) const [inline]

Check if there is a chain. That`s a faster way than a string compare for each lookup.

Returns:
the next Value of the chain if exists.
void ChainEntry::prepend ( ChainEntry pNewEntry )

prepends a new entry to the list.

Parameters:
pNewEntryPointer to the new entry.
ChainEntry * ChainEntry::remove ( const UaNodeId key,
ChainEntry **  ppNext 
)

removes an entry from the list.

Parameters:
keyThe key identifying the entry.
ppNextReturns pointer to the next element. The returned object will not contain a next element because it gets unchained.
Returns:
the pointer to the found (removed) object or NULL if not found.
virtual void ChainEntry::setInvalid (  ) [inline, virtual]

Set the entry to invalid. This method can be overwritten by a derived class to set the internal state to invalid until the object gets deleted when the reference count goes to zero. This method is used if the object should be invalidated but can not be deleted since the lifetime is controlled by the reference count.

Reimplemented in UaVariableCache.


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/hashtable.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/hashtable.cpp