tree structure data management class More...
#include <TreeNode.h>
Public Member Functions | |
| TreeNode () | |
| constructor | |
| TreeNode (T &elm) | |
| constructor | |
| virtual | ~TreeNode () |
| destructor | |
| T & | getElement () |
| gets the element that the node has | |
| void | setElement (T &elm) |
| sets the element that the node has | |
| TreeNode * | getParentNode () |
| gets parent node More... | |
| unsigned int | getNumberOfChildren () |
| gets the number of child nodes More... | |
| TreeNode * | getChild (int index) |
| get child node More... | |
| void | clearChildren () |
| remove all child nodes | |
| TreeNode * | addChild () |
| create child node More... | |
| TreeNode * | addChild (T &elm) |
| create child node More... | |
| void | sortChildren (boost::function< bool(TreeNode< T > &, TreeNode< T > &) > lessFun) |
| sort child nodes More... | |
Protected Member Functions | |
| TreeNode (TreeNode< T > *parent) | |
| constructor More... | |
| TreeNode (TreeNode< T > *parent, T &elm) | |
| constructor More... | |
Protected Attributes | |
| T | m_element |
| std::vector< TreeNode< T > * > | m_children |
| TreeNode< T > * | m_parent |
tree structure data management class
Definition at line 29 of file TreeNode.h.
|
inlineprotected |
|
inlineprotected |
constructor
| [in] | parent | parent node |
| [in] | elm | the element that the node has |
Definition at line 186 of file TreeNode.h.
|
inline |
|
inline |
create child node
| [in] | elm | the element that child node has |
Definition at line 132 of file TreeNode.h.
|
inline |
get child node
| [in] | index | child index |
Definition at line 95 of file TreeNode.h.
|
inline |
gets the number of child nodes
Definition at line 85 of file TreeNode.h.
|
inline |
gets parent node
Definition at line 76 of file TreeNode.h.
|
inline |
sort child nodes
| [in] | lessFun | the function to compare. This function has two Properties. The first parameter is the node to compare. The second parameter is the node to be compared. If the node specified by the first parameter sorts before the node specified by second parameter, this function returns true |
Definition at line 147 of file TreeNode.h.
|
protected |
the array of child nodes
Definition at line 166 of file TreeNode.h.
|
protected |
the element that the node has
Definition at line 163 of file TreeNode.h.
|
protected |
the parent node
Definition at line 169 of file TreeNode.h.
1.8.6