Nebula
Loading...
Searching...
No Matches
Util::SimpleTree< VALUETYPE >::Node Class Reference

#include <simpletree.h>

Detailed Description

template<class VALUETYPE>
class Util::SimpleTree< VALUETYPE >::Node

public node class

Public Member Functions

 Node ()
 default constructor
 Node (const Node &parent, const VALUETYPE &val)
 constructor with parent and value
 ~Node ()
 destructor
const Node & operator[] (IndexT i) const
 get read-only child by index
Node & operator[] (IndexT i)
 get read/write child by index
const Node & Child (IndexT i) const
 get read-only child element at index
Node & Child (IndexT i)
 get read/write child element at index
bool HasParent () const
 return true if the node has a parent
Node & Parent ()
 read/write access to parent
const Node & Parent () const
 read-only access to parent
void Clear ()
 clear children
SizeT Size () const
 number of children
bool IsEmpty () const
 return true if empty
Node & Front () const
 return first element
Node & Back () const
 return last element
void Append (const VALUETYPE &val)
 add element at back of array
void Erase (IndexT i)
 erase at index
void Insert (IndexT index, const VALUETYPE &val)
 insert element before element at index
IndexT Find (const VALUETYPE &val) const
 find identical element (slow);
VALUETYPE & Value ()
 read/write access to value
const VALUETYPE & Value () const
 read-only access to value

Private Attributes

Node * parent
VALUETYPE value
Array< Node * > children

Constructor & Destructor Documentation

◆ Node() [1/2]

template<class VALUETYPE>
Util::SimpleTree< VALUETYPE >::Node::Node ( )

default constructor

◆ Node() [2/2]

template<class VALUETYPE>
Util::SimpleTree< VALUETYPE >::Node::Node ( const Node & parent,
const VALUETYPE & val )

constructor with parent and value

◆ ~Node()

template<class VALUETYPE>
Util::SimpleTree< VALUETYPE >::Node::~Node ( )

destructor

Member Function Documentation

◆ Append()

template<class VALUETYPE>
void Util::SimpleTree< VALUETYPE >::Node::Append ( const VALUETYPE & val)

add element at back of array

◆ Back()

template<class VALUETYPE>
SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Back ( ) const

return last element

◆ Child() [1/2]

template<class VALUETYPE>
SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Child ( IndexT i)

get read/write child element at index

◆ Child() [2/2]

template<class VALUETYPE>
const SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Child ( IndexT i) const

get read-only child element at index

◆ Clear()

template<class VALUETYPE>
void Util::SimpleTree< VALUETYPE >::Node::Clear ( )

clear children

◆ Erase()

template<class VALUETYPE>
void Util::SimpleTree< VALUETYPE >::Node::Erase ( IndexT i)

erase at index

◆ Find()

template<class VALUETYPE>
IndexT Util::SimpleTree< VALUETYPE >::Node::Find ( const VALUETYPE & val) const

find identical element (slow);

◆ Front()

template<class VALUETYPE>
SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Front ( ) const

return first element

◆ HasParent()

template<class VALUETYPE>
bool Util::SimpleTree< VALUETYPE >::Node::HasParent ( ) const

return true if the node has a parent

◆ Insert()

template<class VALUETYPE>
void Util::SimpleTree< VALUETYPE >::Node::Insert ( IndexT index,
const VALUETYPE & val )

insert element before element at index

◆ IsEmpty()

template<class VALUETYPE>
bool Util::SimpleTree< VALUETYPE >::Node::IsEmpty ( ) const

return true if empty

◆ operator[]() [1/2]

template<class VALUETYPE>
SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::operator[] ( IndexT i)

get read/write child by index

◆ operator[]() [2/2]

template<class VALUETYPE>
const SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::operator[] ( IndexT i) const

get read-only child by index

◆ Parent() [1/2]

template<class VALUETYPE>
SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Parent ( )

read/write access to parent

◆ Parent() [2/2]

template<class VALUETYPE>
const SimpleTree< VALUETYPE >::Node & Util::SimpleTree< VALUETYPE >::Node::Parent ( ) const

read-only access to parent

◆ Size()

template<class VALUETYPE>
SizeT Util::SimpleTree< VALUETYPE >::Node::Size ( ) const

number of children

◆ Value() [1/2]

template<class VALUETYPE>
VALUETYPE & Util::SimpleTree< VALUETYPE >::Node::Value ( )

read/write access to value

◆ Value() [2/2]

template<class VALUETYPE>
const VALUETYPE & Util::SimpleTree< VALUETYPE >::Node::Value ( ) const

read-only access to value

Member Data Documentation

◆ children

template<class VALUETYPE>
Array<Node*> Util::SimpleTree< VALUETYPE >::Node::children
private

◆ parent

template<class VALUETYPE>
Node* Util::SimpleTree< VALUETYPE >::Node::parent
private

◆ value

template<class VALUETYPE>
VALUETYPE Util::SimpleTree< VALUETYPE >::Node::value
private

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