UA Ansi C Server Professional
1.3.1.232
|
Data Structures | |
struct | _UaServer_TableEntry |
A UaServer TableEntry Struct. More... | |
struct | _UaServer_HashTable |
A UaServer HashTable Struct. More... |
Functions | |
OpcUa_Void | UaServer_HashTable_Initialize (UaServer_HashTable *pTable, size_t size, pt2GetKeyFromValue fctPtr) |
Initializes a hash table. | |
OpcUa_Void | UaServer_HashTable_Cleanup (UaServer_HashTable *pTable) |
Cleans up hash table struct. | |
OpcUa_Void | UaServer_HashTable_AddElement (UaServer_HashTable *pTable, char *szKey, OpcUa_Void *pData) |
Adds the given value pData with the key pKey to the hash table. | |
OpcUa_Void | UaServer_HashTable_AddAt (UaServer_HashTable *pTable, unsigned int index, OpcUa_Void *pData) |
Adds the given value pData to the hash table at position index. | |
OpcUa_StatusCode | UaServer_HashTable_RemoveAt (UaServer_HashTable *pTable, unsigned int index, OpcUa_Void *pData) |
Removes the given value pData from the hash table at position index. | |
UaServer_TableEntry * | UaServer_HashTable_GetAt (UaServer_HashTable *pTable, unsigned int index) |
Returns the table entry at the given position. | |
OpcUa_Void * | UaServer_HashTable_RemoveElement (UaServer_HashTable *pTable, char *szKey) |
Removes the given element from hash table and returns it. | |
OpcUa_Void * | UaServer_HashTable_Lookup (UaServer_HashTable *pTable, char *szKey) |
Looks up the given element from hash table and returns it. |
OpcUa_Void UaServer_HashTable_AddAt | ( | UaServer_HashTable * | pTable, |
unsigned int | index, | ||
OpcUa_Void * | pData | ||
) |
Adds the given value pData to the hash table at position index.
This is used for prehashed keys or index based data. The differences to a simple array is that this function still uses the hash table's collision reduction stratagy and you can add multiple items at the same position without an error.
pTable | hash table object |
index | index where the value is stored. |
pData | value to add |
OpcUa_Void UaServer_HashTable_AddElement | ( | UaServer_HashTable * | pTable, |
char * | szKey, | ||
OpcUa_Void * | pData | ||
) |
Adds the given value pData with the key pKey to the hash table.
pTable | hash table object |
szKey | key which identifies the value |
pData | value to add |
OpcUa_Void UaServer_HashTable_Cleanup | ( | UaServer_HashTable * | pTable | ) |
Cleans up hash table struct.
This deletes all memory allocated by hash table, but not the data referenced by the table.
pTable | hash table object |
UaServer_TableEntry * UaServer_HashTable_GetAt | ( | UaServer_HashTable * | pTable, |
unsigned int | index | ||
) |
Returns the table entry at the given position.
Use this to iterate over the list yourself.
pTable | hash table object that should be initialized. |
index | index where the value is stored. |
OpcUa_Void UaServer_HashTable_Initialize | ( | UaServer_HashTable * | pTable, |
size_t | size, | ||
pt2GetKeyFromValue | fctPtr | ||
) |
Initializes a hash table.
pTable | hash table object that should be initialized. |
size | Size of hash table. Use a predefined size HASH_SIZE_XXX. |
fctPtr | function pointer to function that retrieves the key string from the data value. |
OpcUa_Void * UaServer_HashTable_Lookup | ( | UaServer_HashTable * | pTable, |
char * | szKey | ||
) |
Looks up the given element from hash table and returns it.
pTable | hash table object |
szKey | key to search for |
OpcUa_StatusCode UaServer_HashTable_RemoveAt | ( | UaServer_HashTable * | pTable, |
unsigned int | index, | ||
OpcUa_Void * | pData | ||
) |
Removes the given value pData from the hash table at position index.
pTable | hash table object |
index | index where the value is stored. |
pData | data to remove |
OpcUa_Void * UaServer_HashTable_RemoveElement | ( | UaServer_HashTable * | pTable, |
char * | szKey | ||
) |
Removes the given element from hash table and returns it.
It searches the element simalar to UaServer_HashTable_Lookup, removes the entry from table and returns the data value.
pTable | hash table object |
szKey | key to search for |