hash node More...


Typedefs | |
| typedef typedefCGUL_BEGIN_C struct cgul_hash_node * | cgul_hash_node_t |
Functions | |
| CGUL_EXPORT const void * | cgul_hash_node__get_key (cgul_exception_t *cex, cgul_hash_node_t n) |
| CGUL_EXPORT void * | cgul_hash_node__get_value (cgul_exception_t *cex, cgul_hash_node_t n) |
| CGUL_EXPORT void | cgul_hash_node__set_value (cgul_exception_t *cex, cgul_hash_node_t n, const void *value) |
| CGUL_EXPORT cgul_hash_node_t | cgul_hash_node__get_prev (cgul_exception_t *cex, cgul_hash_node_t n) |
| CGUL_EXPORT cgul_hash_node_t | cgul_hash_node__get_next (cgul_exception_t *cex, cgul_hash_node_t n) |
| CGUL_EXPORT cgul_hash_node_t | cgul_hash_node__get_older (cgul_exception_t *cex, cgul_hash_node_t n) |
| CGUL_EXPORT cgul_hash_node_t | cgul_hash_node__get_younger (cgul_exception_t *cex, cgul_hash_node_t n) |
This class implements a hash node which holds one key/value pair.
| typedef typedefCGUL_BEGIN_C struct cgul_hash_node* cgul_hash_node_t |
| CGUL_EXPORT const void* cgul_hash_node__get_key | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Get the key for this node.
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node_t instance |
Referenced by cgul_hash_cxx::foldl_keys(), cgul_hash_cxx::foldl_pairs(), cgul_hash_cxx::foldr_keys(), cgul_hash_cxx::foldr_pairs(), and cgul_hash_node_cxx::get_key().
| CGUL_EXPORT void* cgul_hash_node__get_value | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Get the value for this node.
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node_t instance |
Referenced by cgul_hash_cxx::foldl_pairs(), cgul_hash_cxx::foldl_values(), cgul_hash_cxx::foldr_pairs(), cgul_hash_cxx::foldr_values(), and cgul_hash_node_cxx::get_value().
| CGUL_EXPORT void cgul_hash_node__set_value | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n, | ||
| const void * | value | ||
| ) |
Set the value for this node.
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node_t instance |
| [in] | value | new value |
Referenced by cgul_hash_node_cxx::set_value().
| CGUL_EXPORT cgul_hash_node_t cgul_hash_node__get_prev | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Get the previous node in insertion order. This method is a synonym for cgul_hash_node__get_older(). You can use this method to iterate over the hash in reverse insertion order. When there are no more nodes, NULL is returned. You can use cgul_hash__get_back() to get the last node in a cgul_hash in order to start iterating.
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node_t instance |
Referenced by cgul_hash_cxx::foldr_keys(), cgul_hash_cxx::foldr_pairs(), cgul_hash_cxx::foldr_values(), and cgul_hash_node_cxx::get_prev().
| CGUL_EXPORT cgul_hash_node_t cgul_hash_node__get_next | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Get the next node in insertion order. This method is a synonym for cgul_hash_node__get_younger(). You can use this method to iterate over the hash in insertion order. When there are no more nodes, NULL is returned. You can use cgul_hash__get_front() to get the first node in a cgul_hash in order to start iterating.
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node_t instance |
Referenced by cgul_hash_cxx::foldl_keys(), cgul_hash_cxx::foldl_pairs(), cgul_hash_cxx::foldl_values(), cgul_hash_node_cxx::get_next(), and cgul_hash_cxx::traverse_range().
| CGUL_EXPORT cgul_hash_node_t cgul_hash_node__get_older | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Return the next older node. Together with cgul_hash_node__get_younger(), this method lets you traverse the hash in chronological order. If there is no older node, this method returns NULL.
The following example shows how to iterate over the entire hash in reverse chronological order. Notice that you have to start with the youngest node when calling cgul_hash_node__get_older():
cgul_hash_node_t n = cgul_hash__get_youngest(cex, h);
for ( ; n ; n = cgul_hash_node__get_older(cex, n)) {
...
}
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node instance |
Referenced by cgul_hash_node_cxx::get_older().
| CGUL_EXPORT cgul_hash_node_t cgul_hash_node__get_younger | ( | cgul_exception_t * | cex, |
| cgul_hash_node_t | n | ||
| ) |
Return the next younger node. Together with cgul_hash_node__get_older(), this method lets you traverse the hash in chronological order. If there is no younger node, this method returns NULL.
The following example shows how to iterate over the entire hash in chronological order. Notice that you have to start with the oldest node when calling cgul_hash_node__get_younger():
cgul_hash_node_t n = cgul_hash__get_oldest(cex, h);
for ( ; n ; n = cgul_hash_node__get_younger(cex, n)) {
...
}
| [in] | cex | c-style exception |
| [in] | n | cgul_hash_node instance |
Referenced by cgul_hash_node_cxx::get_younger().