cgul_trie_node_cxx Class Reference

C++ bindings for cgul_trie_node More...

#include <cgul_trie_node_cxx.h>

Collaboration diagram for cgul_trie_node_cxx:
Collaboration graph

Public Member Functions

const char * get_key () const
 
void * get_value () const
 
void set_value (void *value)
 
cgul_trie_node_cxxget_prev () const
 
cgul_trie_node_cxxget_next () const
 
cgul_trie_node_cxxget_older () const
 
cgul_trie_node_cxxget_younger () const
 
cgul_trie_node_t get_obj () const
 

Friends

class cgul_trie_cxx
 

Detailed Description

This class provides the C++ bindings for C cgul_trie_node objects. The main purpose of this class is to convert the C-style function calls and exception handling in cgul_trie_node into C++-style function calls and exception handling. This class must not be extended.

Member Function Documentation

§ get_key()

const char* cgul_trie_node_cxx::get_key ( ) const
inline

Return the key stored in this node. The key is used to determine the sort order of the node. If you want to set the value of the key, there is no method to do so because changing the value of a key requires changing the node's position in the cgul_trie. Thus, if you need to change the value of a key, you should delete the node from the cgul_trie and insert a new node with the new value for the key.

Returns
key

References cgul_trie_node__get_key().

§ get_value()

void* cgul_trie_node_cxx::get_value ( ) const
inline

Return the value stored in this node.

Returns
value

References cgul_trie_node__get_value().

§ set_value()

void cgul_trie_node_cxx::set_value ( void *  value)
inline

Set the value stored in this node.

Parameters
[in]value

References cgul_trie_node__set_value().

§ get_prev()

cgul_trie_node_cxx* cgul_trie_node_cxx::get_prev ( ) const
inline

Return the previous node. Together with get_next(), this method lets you traverse the trie in sorted order. If there is no previous node, this method returns NULL.

Returns
previous node

References cgul_trie_node__get_prev().

§ get_next()

cgul_trie_node_cxx* cgul_trie_node_cxx::get_next ( ) const
inline

Return the next node. Together with get_prev(), this method lets you traverse the trie in sorted order. If there is no next node, this method returns NULL.

Returns
next node

References cgul_trie_node__get_next().

§ get_older()

cgul_trie_node_cxx* cgul_trie_node_cxx::get_older ( ) const
inline

Return the next older node. Together with get_younger(), this method lets you traverse the trie in chronological order. If there is no older node, this method returns NULL.

get_older() and get_younger() are faster than get_prev() and get_next() because the latter pair of functions has to walk the trie to find the previous and next nodes in sort order, but the former pair has direct pointers to the younger and older nodes.

The following example shows how to iterate over the entire trie in reverse chronological order. Notice that you have to start with the youngest node when calling get_older():

    cgul_trie_node_cxx* n = t->get_youngest();
    for ( ; n ; n = n->get_older()) {
        ...
    }
Returns
older node

References cgul_trie_node__get_older().

§ get_younger()

cgul_trie_node_cxx* cgul_trie_node_cxx::get_younger ( ) const
inline

Return the next younger node. Together with get_older(), this method lets you traverse the trie in chronological order. If there is no younger node, this method returns NULL.

get_older() and get_younger() are faster than get_prev() and get_next() because the latter pair of functions has to walk the trie to find the previous and next nodes in sort order, but the former pair has direct pointers to the younger and older nodes.

The following example shows how to iterate over the entire trie in chronological order. Notice that you have to start with the oldest node when calling get_younger():

    cgul_trie_node_cxx* n = t->get_oldest();
    for ( ; n ; n = n->get_younger()) {
        ...
    }
Returns
younger node

References cgul_trie_node__get_younger().

§ get_obj()

cgul_trie_node_t cgul_trie_node_cxx::get_obj ( ) const
inline

Get the underlying cgul_trie_node object.

Returns
underlying object

Friends And Related Function Documentation

§ cgul_trie_cxx

friend class cgul_trie_cxx
friend

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