Neo  0.5.0
Developer Documentation
Neo2D::Gui::TreeNode< T > Class Template Reference

Represents a single tree node. More...

#include <Tree.h>

Public Member Functions

TreeNode< T > * getChild (int idx)
 Returns the child that has the given index. More...
 
TreeNode< T > * addChild (T data)
 Adds a child to the node. More...
 
size_t getNumChildren ()
 Returns the number of children this node has. More...
 
void clearChildren ()
 Clears the list of children. Attention: Does not delete any child data! More...
 
getData ()
 Returns the data of this node. More...
 
void setOpen (bool v)
 Configures if this node is considered to be opened up. Important for the tree view to decide whether or not tho show the children. More...
 
bool isOpen ()
 Checks if this node is open. More...
 
 TreeNode (T d)
 
 TreeNode ()
 
 ~TreeNode ()
 

Protected Attributes

m_data
 
bool m_opened
 
std::vector< TreeNode< T > * > m_children
 

Detailed Description

template<class T>
class Neo2D::Gui::TreeNode< T >

Represents a single tree node.

Author
Yannick Pflanzer

Constructor & Destructor Documentation

template<class T>
Neo2D::Gui::TreeNode< T >::TreeNode ( d)
inline
template<class T>
Neo2D::Gui::TreeNode< T >::TreeNode ( )
inline
template<class T>
Neo2D::Gui::TreeNode< T >::~TreeNode ( )
inline

Member Function Documentation

template<class T>
TreeNode<T>* Neo2D::Gui::TreeNode< T >::addChild ( data)
inline

Adds a child to the node.

Parameters
dataThe data of the new child node.
Returns
A pointer to the new node.
template<class T>
void Neo2D::Gui::TreeNode< T >::clearChildren ( )
inline

Clears the list of children. Attention: Does not delete any child data!

template<class T>
TreeNode<T>* Neo2D::Gui::TreeNode< T >::getChild ( int  idx)
inline

Returns the child that has the given index.

Parameters
idxThe index.
Returns
The child.
template<class T>
T Neo2D::Gui::TreeNode< T >::getData ( )
inline

Returns the data of this node.

Returns
The data.
template<class T>
size_t Neo2D::Gui::TreeNode< T >::getNumChildren ( )
inline

Returns the number of children this node has.

Returns
The number of children.
template<class T>
bool Neo2D::Gui::TreeNode< T >::isOpen ( )
inline

Checks if this node is open.

Returns
A boolean value.
template<class T>
void Neo2D::Gui::TreeNode< T >::setOpen ( bool  v)
inline

Configures if this node is considered to be opened up. Important for the tree view to decide whether or not tho show the children.

Parameters
vThe boolean value.

Member Data Documentation

template<class T>
std::vector<TreeNode<T>*> Neo2D::Gui::TreeNode< T >::m_children
protected
template<class T>
T Neo2D::Gui::TreeNode< T >::m_data
protected
template<class T>
bool Neo2D::Gui::TreeNode< T >::m_opened
protected

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