DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Member Functions | Private Types | Private Attributes | List of all members
Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches Class Reference

Public Member Functions

virtual bool isLeaf () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
ConstIterator find (const Node &node) const
 
template<typename NodeIterator >
Leaf & insertSuccessiveBranches (NodeIterator begin, NodeIterator end, const Leaf &info)
 
- Public Member Functions inherited from Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeElement
template<typename NodeIterator >
bool getLeaf (NodeIterator begin, NodeIterator end, Leaf &result) const
 

Private Types

using Map = _Map< Node, std::unique_ptr< TreeElement > >
 
using ConstIterator = typename Map::const_iterator
 

Private Attributes

Map _branches
 

Detailed Description

template<typename Node, typename Leaf, template< typename, typename > class _Map>
class Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches

From a structural node of the NAryTree start many branches. Each Branch ends with a structural node. A structural node is either a Node from which start new branches or a Node that is associated with a Leaf. The NAryTree has no explicit structural root. It starts as a set of branches lead to a first set of Nodes. Therefore TreeBranches implement a set of branches, each branch leads to a Node.

Definition at line 157 of file NAryTree.hh.

Member Typedef Documentation

◆ ConstIterator

template<typename Node, typename Leaf, template< typename, typename > class _Map>
using Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::ConstIterator = typename Map::const_iterator
private

Definition at line 171 of file NAryTree.hh.

◆ Map

template<typename Node, typename Leaf, template< typename, typename > class _Map>
using Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::Map = _Map<Node, std::unique_ptr<TreeElement> >
private

Definition at line 167 of file NAryTree.hh.

Member Function Documentation

◆ begin()

template<typename Node, typename Leaf, template< typename, typename > class _Map>
ConstIterator Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::begin ( ) const
inline
Returns
the starting iterator over the range of branches

Definition at line 191 of file NAryTree.hh.

◆ end()

template<typename Node, typename Leaf, template< typename, typename > class _Map>
ConstIterator Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::end ( ) const
inline
Returns
the ending iterator over the range of branches

Definition at line 201 of file NAryTree.hh.

◆ find()

template<typename Node, typename Leaf, template< typename, typename > class _Map>
ConstIterator Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::find ( const Node node) const
inline
Parameters
nodea Node
Returns
an iterator on the branch leading to the Node 'node', end() otherwise

Definition at line 212 of file NAryTree.hh.

Referenced by Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeElement::getLeaf().

◆ insertSuccessiveBranches()

template<typename Node, typename Leaf, template< typename, typename > class _Map>
template<typename NodeIterator >
Leaf& Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::insertSuccessiveBranches ( NodeIterator  begin,
NodeIterator  end,
const Leaf &  info 
)
inline

Insert a leaf associated with the Node range [begin,end[ Be aware that if a leaf already exists, it is replaced. If a branch associated to a range bigger than [begin,end[ already exists, it is removed.

Parameters
beginthe starting iterator over a range of Nodes
endthe ending iterator over a range of Nodes
infothe piece of information that will be associated with the range in the tree
Returns
a reference to the inserted leaf

Definition at line 230 of file NAryTree.hh.

References Diades::Utils::NAryTree< Node, Leaf, _Map >::insertSuccessiveBranches().

◆ isLeaf()

template<typename Node, typename Leaf, template< typename, typename > class _Map>
virtual bool Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::isLeaf ( ) const
inlinevirtual
Returns
false as a TreeElement

Implements Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeElement.

Definition at line 181 of file NAryTree.hh.

Member Data Documentation

◆ _branches

template<typename Node, typename Leaf, template< typename, typename > class _Map>
Map Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::_branches
private

Definition at line 168 of file NAryTree.hh.


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