bitwise trie node More...
Typedefs | |
typedef typedefCGUL_BEGIN_C struct cgul_bitwise_trie_node * | cgul_bitwise_trie_node_t |
Functions | |
CGUL_EXPORT unsigned long int | cgul_bitwise_trie_node__get_index (cgul_exception_t *cex, cgul_bitwise_trie_node_t n) |
CGUL_EXPORT void * | cgul_bitwise_trie_node__get_value (cgul_exception_t *cex, cgul_bitwise_trie_node_t n) |
CGUL_EXPORT void | cgul_bitwise_trie_node__set_value (cgul_exception_t *cex, cgul_bitwise_trie_node_t n, const void *value) |
CGUL_EXPORT cgul_bitwise_trie_node_t | cgul_bitwise_trie_node__get_older (cgul_exception_t *cex, cgul_bitwise_trie_node_t n) |
CGUL_EXPORT cgul_bitwise_trie_node_t | cgul_bitwise_trie_node__get_younger (cgul_exception_t *cex, cgul_bitwise_trie_node_t n) |
This class implements a bitwise trie node which holds one index/value pair.
typedef typedefCGUL_BEGIN_C struct cgul_bitwise_trie_node* cgul_bitwise_trie_node_t |
Opaque pointer to a cgul_bitwise_trie_node
instance.
CGUL_EXPORT unsigned long int cgul_bitwise_trie_node__get_index | ( | cgul_exception_t * | cex, |
cgul_bitwise_trie_node_t | n | ||
) |
Return the index stored in this node. If you want to set the value of the index, there is no method to do so because changing the value of a index requires changing the node's position in the cgul_bitwise_trie
. Thus, if you need to change the value of a index, you should delete the node from the cgul_bitwise_trie
and insert a new node with the new value for the index.
[in] | cex | c-style exception |
[in] | n | cgul_bitwise_trie_node instance |
CGUL_EXPORT void* cgul_bitwise_trie_node__get_value | ( | cgul_exception_t * | cex, |
cgul_bitwise_trie_node_t | n | ||
) |
Return the value stored in this node.
[in] | cex | c-style exception |
[in] | n | cgul_bitwise_trie_node instance |
CGUL_EXPORT void cgul_bitwise_trie_node__set_value | ( | cgul_exception_t * | cex, |
cgul_bitwise_trie_node_t | n, | ||
const void * | value | ||
) |
Set the value stored in this node.
[in] | cex | c-style exception |
[in] | n | cgul_bitwise_trie_node instance |
[in] | value |
CGUL_EXPORT cgul_bitwise_trie_node_t cgul_bitwise_trie_node__get_older | ( | cgul_exception_t * | cex, |
cgul_bitwise_trie_node_t | n | ||
) |
Return the next older node. Together with cgul_bitwise_trie_node__get_younger()
, this method lets you traverse the tree in chronological order. If there is no older node, this method returns NULL
.
The following example shows how to iterate over the entire tree in reverse chronological order. Notice that you have to start with the youngest node when calling cgul_bitwise_trie_node__get_older()
:
cgul_bitwise_trie_node_t n = cgul_bitwise_trie__get_youngest(cex, t); for ( ; n ; n = cgul_bitwise_trie_node__get_older(cex, n)) { ... }
[in] | cex | c-style exception |
[in] | n | cgul_bitwise_trie_node instance |
CGUL_EXPORT cgul_bitwise_trie_node_t cgul_bitwise_trie_node__get_younger | ( | cgul_exception_t * | cex, |
cgul_bitwise_trie_node_t | n | ||
) |
Return the next younger node. Together with cgul_bitwise_trie_node__get_older()
, this method lets you traverse the tree in chronological order. If there is no younger node, this method returns NULL
.
The following example shows how to iterate over the entire tree in chronological order. Notice that you have to start with the oldest node when calling cgul_bitwise_trie_node__get_younger()
:
cgul_bitwise_trie_node_t n = cgul_bitwise_trie__get_oldest(cex, t); for ( ; n ; n = cgul_bitwise_trie_node__get_younger(cex, n)) { ... }
[in] | cex | c-style exception |
[in] | n | cgul_bitwise_trie_node instance |