C++ Based OPC UA Client/Server SDK  1.6.2.402
ChainEntry Class Referenceabstract

ChainEntry. More...

#include <hashtable.h>

Inherits ReferenceCounter.

Inherited by UaNode.

Public Member Functions

 ChainEntry ()
 construction
 
ChainEntryfind (const UaNodeId &key, ChainEntry **ppPrevious)
 finds the right entry in the chain. More...
 
void add (ChainEntry *pNewEntry)
 adds a new entry to the list. More...
 
void prepend (ChainEntry *pNewEntry)
 prepends a new entry to the list. More...
 
ChainEntryremove (const UaNodeId &key, ChainEntry **ppNext)
 removes an entry from the list. More...
 
virtual UaNodeId getKey () const =0
 this returns the key of this entry. More...
 
ChainEntrygetNext () const
 Check if there is a chain. More...
 
virtual void setInvalid ()
 Set the entry to invalid. More...
 
void clearChain ()
 Clear the chain when the hashtable is cleared.
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter ()
 construction
 
virtual ~ReferenceCounter ()
 destruction
 

Protected Member Functions

virtual ~ChainEntry ()
 destruction
 

Detailed Description

ChainEntry.

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.

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

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, OpcUa::ConditionType, and OpcUa::BaseVariableType.


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