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

Tree node with any but fixed number of children. More...

#include <tree_base.hpp>

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

Public Member Functions

 AnyaryNode (ext::ptr_array< Data, arity > c)
 Constructor based on array of child nodes. More...
 
 ~AnyaryNode () noexcept override=default
 Destructor of the class. More...
 
 AnyaryNode (const AnyaryNode &other)
 Copy constructor. More...
 
 AnyaryNode (AnyaryNode &&other) noexcept
 Move constructor. 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...
 
template<size_t N>
const Data & getChild () const
 Getter of the child node based on compile time index. More...
 
template<size_t N>
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...
 
template<size_t N>
void setChild (const Data &d)
 Setter of the child node based on compile time index. More...
 
template<size_t N>
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, std::size_t arity, class Base = Data>
class ext::AnyaryNode< Data, arity, Base >

Tree node with any but fixed number of children.

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

Constructor & Destructor Documentation

◆ AnyaryNode() [1/3]

template<class Data , std::size_t arity, class Base = Data>
ext::AnyaryNode< Data, arity, Base >::AnyaryNode ( ext::ptr_array< Data, arity >  c)
inline

Constructor based on array of child nodes.

Parameters
cthe array of child nodes

◆ ~AnyaryNode()

template<class Data , std::size_t arity, class Base = Data>
ext::AnyaryNode< Data, arity, Base >::~AnyaryNode ( )
overridedefaultnoexcept

Destructor of the class.

◆ AnyaryNode() [2/3]

template<class Data , std::size_t arity, class Base = Data>
ext::AnyaryNode< Data, arity, Base >::AnyaryNode ( const AnyaryNode< Data, arity, Base > &  other)
inline

Copy constructor.

◆ AnyaryNode() [3/3]

template<class Data , std::size_t arity, class Base = Data>
ext::AnyaryNode< Data, arity, Base >::AnyaryNode ( AnyaryNode< Data, arity, Base > &&  other)
inlinenoexcept

Move constructor.

Member Function Documentation

◆ begin() [1/2]

template<class Data , std::size_t arity, class Base = Data>
ext::ptr_array< Data, arity >::iterator ext::AnyaryNode< Data, arity, Base >::begin ( )
inline

Getter of an iterator to the begining of children array.

Returns
begin iterator
Here is the call graph for this function:

◆ begin() [2/2]

template<class Data , std::size_t arity, class Base = Data>
ext::ptr_array< Data, arity >::const_iterator ext::AnyaryNode< Data, arity, Base >::begin ( ) const
inline

Getter of an iterator to the begining of children array.

Returns
begin iterator
Here is the call graph for this function:

◆ end() [1/2]

template<class Data , std::size_t arity, class Base = Data>
ext::ptr_array< Data, arity >::iterator ext::AnyaryNode< Data, arity, Base >::end ( )
inline

Getter of an iterator to the end of children array.

Returns
end iterator
Here is the call graph for this function:

◆ end() [2/2]

template<class Data , std::size_t arity, class Base = Data>
ext::ptr_array< Data, arity >::const_iterator ext::AnyaryNode< Data, arity, Base >::end ( ) const
inline

Getter of an iterator to the end of children array.

Returns
end iterator
Here is the call graph for this function:

◆ getChild() [1/2]

template<class Data , std::size_t arity, class Base = Data>
template<size_t N>
Data & ext::AnyaryNode< Data, arity, Base >::getChild ( )
inline

Getter of the child node based on compile time index.

Template Parameters
Nthe index of the node
Returns
child node at given index

◆ getChild() [2/2]

template<class Data , std::size_t arity, class Base = Data>
template<size_t N>
const Data & ext::AnyaryNode< Data, arity, Base >::getChild ( ) const
inline

Getter of the child node based on compile time index.

Template Parameters
Nthe index of the node
Returns
child node at given index

◆ getChildren() [1/3]

template<class Data , std::size_t arity, class Base = Data>
const ext::ptr_array< Data, arity > & ext::AnyaryNode< Data, arity, Base >::getChildren ( ) &
inline

Getter of the child nodes.

Returns
child nodes

◆ getChildren() [2/3]

template<class Data , std::size_t arity, class Base = Data>
ext::ptr_array< Data, arity > && ext::AnyaryNode< Data, arity, Base >::getChildren ( ) &&
inline

Getter of the child nodes.

Returns
child nodes

◆ getChildren() [3/3]

template<class Data , std::size_t arity, class Base = Data>
const ext::ptr_array< Data, arity > & ext::AnyaryNode< Data, arity, Base >::getChildren ( ) const &
inline

Getter of the child nodes.

Returns
child nodes

◆ operator=() [1/2]

template<class Data , std::size_t arity, class Base = Data>
AnyaryNode & ext::AnyaryNode< Data, arity, Base >::operator= ( AnyaryNode< Data, arity, Base > &&  other)
inlinenoexcept

move operator of assignment.

Here is the call graph for this function:

◆ operator=() [2/2]

template<class Data , std::size_t arity, class Base = Data>
AnyaryNode & ext::AnyaryNode< Data, arity, Base >::operator= ( const AnyaryNode< Data, arity, Base > &  other)
inline

Copy operator of assignment.

◆ setChild() [1/2]

template<class Data , std::size_t arity, class Base = Data>
template<size_t N>
void ext::AnyaryNode< Data, arity, Base >::setChild ( const Data &  d)
inline

Setter of the child node based on compile time index.

Template Parameters
Nthe index of the node
Returns
child node at given index
Here is the call graph for this function:

◆ setChild() [2/2]

template<class Data , std::size_t arity, class Base = Data>
template<size_t N>
void ext::AnyaryNode< Data, arity, Base >::setChild ( Data &&  d)
inline

Setter of the child node based on compile time index.

Template Parameters
Nthe index of the node
Returns
child node at given index
Here is the call graph for this function:

◆ setChildren()

template<class Data , std::size_t arity, class Base = Data>
void ext::AnyaryNode< Data, arity, Base >::setChildren ( ext::ptr_array< Data, arity >  c)
inline

Setter of the child nodes.

Parameters
cchild nodes

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