#include <linked.h>
Public Member Functions | |
treemap * | find (const char *name) const |
Find a subnode from our node by name. | |
const T & | get (void) const |
Return the typed value of this node. | |
treemap * | getChild (const char *name) const |
Get direct typed child node of our node of specified name. | |
const T & | getData (void) const |
Get the data value of a data based value tree. | |
treemap * | getFirst (void) const |
Get first child of our node. | |
treemap * | getIndexed (unsigned index) const |
Get child member node by index. | |
treemap * | getLeaf (const char *name) const |
Find a direct typed leaf node on our node. | |
treemap * | getParent (void) const |
Get the typed parent node for our node. | |
const T | getPointer (void) const |
Get the pointer of a pointer based value tree. | |
T | getValue (const char *name) const |
Get the value pointer of a leaf node of a pointer tree. | |
bool | isAttribute (void) const |
Test if this node is a leaf node for a tree pointer table. | |
treemap * | leaf (const char *name) const |
Search for a leaf node of our node. | |
const T & | operator* () const |
Return typed value of this node by pointer reference. | |
void | operator= (const T &data) |
Assign the value of our node. | |
treemap * | path (const char *path) const |
Find a subnode by pathname. | |
void | set (const T &reference) |
Set the value of a data based value tree. | |
void | setPointer (const T pointer) |
Set the pointer of a pointer based value tree. | |
treemap (treemap *parent, char *name, T &reference) | |
Construct a child node on an existing tree and assign it's value. | |
treemap (treemap *parent, char *name) | |
Construct a child node on an existing tree. | |
treemap (const treemap &source) | |
Construct a copy of the treemap object. | |
treemap (char *name=NULL) | |
Construct a typed root node for the tree. | |
Static Public Member Functions | |
static T | getPointer (treemap *node) |
Return value from tree element when value is a pointer. | |
Protected Attributes | |
T | value |
This can be used to form XML document trees or other data structures that can be organized in trees. The NamedTree class is used to manage the structure of the tree, and the type specified is embedded as a data value object which can be manipulated. Name identifiers are assumed to be dynamically allocated if tree node elements are deletable.
Embedded values can either be of direct types that are then stored as part of the template object, or of class types that are data pointers. The latter might be used for trees that contain data which might be parsed dynamically from a document and/or saved on a heap. Pointer trees assume that NULL pointers are for nodes that are empty, and that NULL data value nodes with children are trunk nodes. Generally data values are then allocated with a pointer stored in pure leaf nodes.
Definition at line 1538 of file linked.h.
ucc::treemap< T >::treemap | ( | char * | name = NULL |
) | [inline] |
ucc::treemap< T >::treemap | ( | const treemap< T > & | source | ) | [inline] |
ucc::treemap< T >::treemap | ( | treemap< T > * | parent, | |
char * | name | |||
) | [inline] |
ucc::treemap< T >::treemap | ( | treemap< T > * | parent, | |
char * | name, | |||
T & | reference | |||
) | [inline] |
treemap* ucc::treemap< T >::find | ( | const char * | name | ) | const [inline] |
Find a subnode from our node by name.
This performs a recursive search.
name | to search for. |
Reimplemented from ucc::NamedTree.
const T& ucc::treemap< T >::get | ( | void | ) | const [inline] |
treemap* ucc::treemap< T >::getChild | ( | const char * | name | ) | const [inline] |
Get direct typed child node of our node of specified name.
This does not perform a recursive search.
name | of child node. |
Reimplemented from ucc::NamedTree.
const T& ucc::treemap< T >::getData | ( | void | ) | const [inline] |
treemap* ucc::treemap< T >::getFirst | ( | void | ) | const [inline] |
Get first child of our node.
This is useful for iterating children.
Reimplemented from ucc::NamedTree.
treemap* ucc::treemap< T >::getIndexed | ( | unsigned | index | ) | const [inline] |
Get child member node by index.
index | of child member. |
Reimplemented from ucc::NamedTree.
treemap* ucc::treemap< T >::getLeaf | ( | const char * | name | ) | const [inline] |
Find a direct typed leaf node on our node.
A leaf node is a node that has no children of it's own. This does not perform a recursive search.
name | of leaf child node to find. |
Reimplemented from ucc::NamedTree.
treemap* ucc::treemap< T >::getParent | ( | void | ) | const [inline] |
Get the typed parent node for our node.
Reimplemented from ucc::NamedTree.
const T ucc::treemap< T >::getPointer | ( | void | ) | const [inline] |
static T ucc::treemap< T >::getPointer | ( | treemap< T > * | node | ) | [inline, static] |
T ucc::treemap< T >::getValue | ( | const char * | name | ) | const [inline] |
bool ucc::treemap< T >::isAttribute | ( | void | ) | const [inline] |
treemap* ucc::treemap< T >::leaf | ( | const char * | name | ) | const [inline] |
Search for a leaf node of our node.
This performs a recursive search.
name | to search for. |
Reimplemented from ucc::NamedTree.
const T& ucc::treemap< T >::operator* | ( | ) | const [inline] |
void ucc::treemap< T >::operator= | ( | const T & | data | ) | [inline] |
treemap* ucc::treemap< T >::path | ( | const char * | path | ) | const [inline] |
Find a subnode by pathname.
This is the same as the NamedTree path member function.
path | name to search for node. |
Reimplemented from ucc::NamedTree.
void ucc::treemap< T >::set | ( | const T & | reference | ) | [inline] |
void ucc::treemap< T >::setPointer | ( | const T | pointer | ) | [inline] |