cgul_hash_node_cxx Class Reference

C++ bindings for cgul_hash_node More...

#include <cgul_hash_node_cxx.h>

Collaboration diagram for cgul_hash_node_cxx:
Collaboration graph

Public Member Functions

const void * get_key () const
 
void * get_value () const
 
void set_value (const void *value)
 
cgul_hash_node_cxxget_prev () const
 
cgul_hash_node_cxxget_next () const
 
cgul_hash_node_cxxget_older () const
 
cgul_hash_node_cxxget_younger () const
 

Friends

class cgul_hash_cxx
 

Detailed Description

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

Member Function Documentation

§ get_key()

const void* cgul_hash_node_cxx::get_key ( ) const
inline

Get the key for this node.

Returns
key

References cgul_hash_node__get_key().

§ get_value()

void* cgul_hash_node_cxx::get_value ( ) const
inline

Get the value for this node.

Returns
value

References cgul_hash_node__get_value().

§ set_value()

void cgul_hash_node_cxx::set_value ( const void *  value)
inline

Set the value for this node.

Parameters
[in]valuenew value

References cgul_hash_node__set_value().

§ get_prev()

cgul_hash_node_cxx* cgul_hash_node_cxx::get_prev ( ) const
inline

Get the previous node in insertion order. This method is a synonym for 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 hash in order to start iterating.

Returns
previous node
See also
get_older()

References cgul_hash_node__get_prev().

§ get_next()

cgul_hash_node_cxx* cgul_hash_node_cxx::get_next ( ) const
inline

Get the next node in insertion order. This method is a synonym for 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.

Returns
previous node
See also
get_younger()

References cgul_hash_node__get_next().

§ get_older()

cgul_hash_node_cxx* cgul_hash_node_cxx::get_older ( ) const
inline

Return the next older node. Together with 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 get_older():

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

References cgul_hash_node__get_older().

§ get_younger()

cgul_hash_node_cxx* cgul_hash_node_cxx::get_younger ( ) const
inline

Return the next younger node. Together with 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 get_younger():

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

References cgul_hash_node__get_younger().

Friends And Related Function Documentation

§ cgul_hash_cxx

friend class cgul_hash_cxx
friend

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