Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
ext::UnaryNode< Data, Base > Class Template Reference

Unary node is specialisation of Anyary node to one child. More...

#include <tree_base.hpp>

Inheritance diagram for ext::UnaryNode< Data, Base >:
[legend]
Collaboration diagram for ext::UnaryNode< Data, Base >:
[legend]

Public Member Functions

 UnaryNode (const Data &c)
 Constructor of the class accepting the child node. More...
 
 UnaryNode (Data &&c)
 Constructor of the class accepting the child node. More...
 
Data & getChild ()
 Getter of the child of the node. More...
 
const Data & getChild () const
 Getter of the child of the node. More...
 
void setChild (const Data &c)
 Setter of the child of the node. More...
 
void setChild (Data &&c)
 Setter of the child of the node. More...
 
- Public Member Functions inherited from ext::AnyaryNode< Data, 1, Data >
 AnyaryNode (ext::ptr_array< Data, arity > c)
 Constructor based on array of child nodes. More...
 
 AnyaryNode (const AnyaryNode &other)
 Copy constructor. More...
 
 AnyaryNode (AnyaryNode &&other) noexcept
 Move constructor. More...
 
 ~AnyaryNode () noexcept override=default
 Destructor of the class. More...
 
AnyaryNodeoperator= (const AnyaryNode &other)
 Copy operator of assignment. More...
 
AnyaryNodeoperator= (AnyaryNode &&other) noexcept
 move operator of assignment. More...
 
const ext::ptr_array< Data, arity > & getChildren () &
 Getter of the child nodes. More...
 
const ext::ptr_array< Data, arity > & getChildren () const &
 Getter of the child nodes. More...
 
ext::ptr_array< Data, arity > && getChildren () &&
 Getter of the child nodes. More...
 
const Data & getChild () const
 Getter of the child node based on compile time index. More...
 
Data & getChild ()
 Getter of the child node based on compile time index. More...
 
void setChildren (ext::ptr_array< Data, arity > c)
 Setter of the child nodes. More...
 
void setChild (const Data &d)
 Setter of the child node based on compile time index. More...
 
void setChild (Data &&d)
 Setter of the child node based on compile time index. More...
 
ext::ptr_array< Data, arity >::iterator begin ()
 Getter of an iterator to the begining of children array. More...
 
ext::ptr_array< Data, arity >::const_iterator begin () const
 Getter of an iterator to the begining of children array. More...
 
ext::ptr_array< Data, arity >::iterator end ()
 Getter of an iterator to the end of children array. More...
 
ext::ptr_array< Data, arity >::const_iterator end () const
 Getter of an iterator to the end of children array. More...
 

Detailed Description

template<class Data, class Base = Data>
class ext::UnaryNode< Data, Base >

Unary node is specialisation of Anyary node to one child.

Template Parameters
Datathe base class of the actual tree nodes hierarchy on top of this one
Basethe actual class from the actual tree nodes hierarchy

Constructor & Destructor Documentation

◆ UnaryNode() [1/2]

template<class Data , class Base = Data>
ext::UnaryNode< Data, Base >::UnaryNode ( const Data &  c)
inline

Constructor of the class accepting the child node.

Parameters
cthe to be child node of the new node

◆ UnaryNode() [2/2]

template<class Data , class Base = Data>
ext::UnaryNode< Data, Base >::UnaryNode ( Data &&  c)
inline

Constructor of the class accepting the child node.

Parameters
cthe to be child node of the new node

Member Function Documentation

◆ getChild() [1/2]

template<class Data , class Base = Data>
Data & ext::UnaryNode< Data, Base >::getChild ( )
inline

Getter of the child of the node.

Returns
the child of the node
Here is the caller graph for this function:

◆ getChild() [2/2]

template<class Data , class Base = Data>
const Data & ext::UnaryNode< Data, Base >::getChild ( ) const
inline

Getter of the child of the node.

Returns
the child of the node

◆ setChild() [1/2]

template<class Data , class Base = Data>
void ext::UnaryNode< Data, Base >::setChild ( const Data &  c)
inline

Setter of the child of the node.

Parameters
cthe child of the node
Here is the caller graph for this function:

◆ setChild() [2/2]

template<class Data , class Base = Data>
void ext::UnaryNode< Data, Base >::setChild ( Data &&  c)
inline

Setter of the child of the node.

Parameters
cthe child of the node

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