cgul_list_node.h File Reference

linked list node More...

#include "cgul_common.h"
#include "cgul_exception.h"
Include dependency graph for cgul_list_node.h:
This graph shows which files directly or indirectly include this file:

Typedefs

typedef typedefCGUL_BEGIN_C struct cgul_list_node * cgul_list_node_t
 

Functions

CGUL_EXPORT void * cgul_list_node__get_value (cgul_exception_t *cex, cgul_list_node_t n)
 
CGUL_EXPORT void cgul_list_node__set_value (cgul_exception_t *cex, cgul_list_node_t n, const void *value)
 
CGUL_EXPORT cgul_list_node_t cgul_list_node__get_prev (cgul_exception_t *cex, cgul_list_node_t n)
 
CGUL_EXPORT cgul_list_node_t cgul_list_node__get_next (cgul_exception_t *cex, cgul_list_node_t n)
 

Detailed Description

This class implements a linked list node which holds one value.

Author
Paul Serice

Typedef Documentation

§ cgul_list_node_t

typedef typedefCGUL_BEGIN_C struct cgul_list_node* cgul_list_node_t

Opaque pointer to a cgul_list_node instance.

Function Documentation

§ cgul_list_node__get_value()

CGUL_EXPORT void* cgul_list_node__get_value ( cgul_exception_t cex,
cgul_list_node_t  n 
)

Return the value stored in the node.

Parameters
[in]cexc-style exception
[in]ncgul_list_node instance
Returns
value stored in n

Referenced by cgul_list_cxx::foldl(), cgul_list_cxx::foldr(), and cgul_list_node_cxx::get_value().

§ cgul_list_node__set_value()

CGUL_EXPORT void cgul_list_node__set_value ( cgul_exception_t cex,
cgul_list_node_t  n,
const void *  value 
)

Set the value to be stored in the node.

Parameters
[in]cexc-style exception
[in]ncgul_list_node instance
[in]valuevalue to be stored in the node

Referenced by cgul_list_node_cxx::set_value().

§ cgul_list_node__get_prev()

CGUL_EXPORT cgul_list_node_t cgul_list_node__get_prev ( cgul_exception_t cex,
cgul_list_node_t  n 
)

Return the previous node. You can use this method to iterate over the list. When there are no more nodes, NULL is returned. You can use cgul_list__get_back() to get the last node in a cgul_list in order to start iterating. A cgul_list_node__set_prev() exists, but it is private.

Parameters
[in]cexc-style exception
[in]ncgul_list_node instance
Returns
previous node

Referenced by cgul_list_cxx::foldr(), and cgul_list_node_cxx::get_prev().

§ cgul_list_node__get_next()

CGUL_EXPORT cgul_list_node_t cgul_list_node__get_next ( cgul_exception_t cex,
cgul_list_node_t  n 
)

Return the next node. You can use this method to iterate over the list. When there are no more nodes, NULL is returned. You can use cgul_list__get_front() to get the first node in a cgul_list in order to start iterating. A cgul_list_node__set_next() exists, but it is private.

Parameters
[in]cexc-style exception
[in]ncgul_list_node instance
Returns
next node

Referenced by cgul_list_cxx::foldl(), cgul_list_node_cxx::get_next(), and cgul_list_cxx::traverse_range().