OpenDaVINCI  4.16.0
odcore::base::TreeNode< T > Class Template Reference

#include <TreeNode.h>

Public Member Functions

 TreeNode ()
 
virtual ~TreeNode ()
 
void setValue (T value)
 
getValue ()
 
TreeNode< T > * getParent ()
 
void setParent (TreeNode< T > *parent)
 
void addChild (TreeNode< T > *child)
 
vector< TreeNode< T > * > getChildren ()
 

Detailed Description

template<typename T>
class odcore::base::TreeNode< T >

This class represents a generic tree data structure.

Constructor & Destructor Documentation

template<typename T>
odcore::base::TreeNode< T >::TreeNode ( )
inline
template<typename T>
virtual odcore::base::TreeNode< T >::~TreeNode ( )
inlinevirtual

Member Function Documentation

template<typename T>
void odcore::base::TreeNode< T >::addChild ( TreeNode< T > *  child)
inline

This method adds a child.

Parameters
childChild to be added.

References odcore::base::TreeNode< T >::setParent().

template<typename T>
vector<TreeNode<T>* > odcore::base::TreeNode< T >::getChildren ( )
inline

This method returns the list of children.

Returns
List of children.
template<typename T>
TreeNode<T>* odcore::base::TreeNode< T >::getParent ( )
inline

This method returns the parent node.

Returns
Parental node.
template<typename T>
T odcore::base::TreeNode< T >::getValue ( )
inline

This method returns the value.

Returns
Value for this node.
template<typename T>
void odcore::base::TreeNode< T >::setParent ( TreeNode< T > *  parent)
inline

This method sets the parent node.

Parameters
parentParental node.

Referenced by odcore::base::TreeNode< T >::addChild().

template<typename T>
void odcore::base::TreeNode< T >::setValue ( value)
inline

This method sets the value for this tree node.

Parameters
valueValue.