C++ Based OPC UA Client/Server/PubSub SDK
1.7.9.586
|
#include <hashtable.h>
Inherits ReferenceCounter.
Inherited by UaNode.
Public Member Functions | |
ChainEntry () | |
construction | |
ChainEntry * | find (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... | |
ChainEntry * | remove (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... | |
ChainEntry * | getNext () 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 | |
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.
void ChainEntry::add | ( | ChainEntry * | pNewEntry | ) |
adds a new entry to the list.
pNewEntry | Pointer to the new entry. |
ChainEntry * ChainEntry::find | ( | const UaNodeId & | key, |
ChainEntry ** | ppPrevious | ||
) |
finds the right entry in the chain.
key | The key identifying the entry. |
ppPrevious | Returns the pointer to the previous entry. Needed to change the linked list. |
|
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.
|
inline |
Check if there is a chain.
That`s a faster way than a string compare for each lookup.
void ChainEntry::prepend | ( | ChainEntry * | pNewEntry | ) |
prepends a new entry to the list.
pNewEntry | Pointer to the new entry. |
ChainEntry * ChainEntry::remove | ( | const UaNodeId & | key, |
ChainEntry ** | ppNext | ||
) |
removes an entry from the list.
key | The key identifying the entry. |
ppNext | Returns pointer to the next element. The returned object will not contain a next element because it gets unchained. |
|
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, OpcUa::BaseVariableType, and OpcUa::FileType.