DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <NAryTree.hh>
Classes | |
class | TreeBranches |
class | TreeElement |
class | TreeLeaf |
Public Member Functions | |
NAryTree ()=default | |
Default constructor. More... | |
NAryTree (NAryTree const &other)=default | |
NAryTree & | operator= (NAryTree const &other)=default |
NAryTree (NAryTree &&other)=default | |
NAryTree & | operator= (NAryTree &&other)=default |
~NAryTree ()=default | |
Destructor. More... | |
template<typename NodeIterator > | |
Leaf & | insertSuccessiveBranches (NodeIterator begin, NodeIterator end, const Leaf &info) |
template<typename NodeIterator > | |
bool | getLeaf (NodeIterator begin, NodeIterator end, Leaf &result) |
void | clear () |
Private Attributes | |
std::unique_ptr< TreeBranches > | _firstBranches |
This class is a specific n-ary tree of nodes. Each branch of the tree ends with a node associated with a leaf. The way the branches are connected with their root is a Map. Be aware that is not possible to associated a Leaf to a sub-branch. This class is used to for instance to implement State tables that associates to a vector of local states (State = Node) a global information (Leaf)
After some tests the use of _Map=std::map is slower than _Map=std::unordered_map (Node = int) (Leaf = string) however this looks having the same computational trend. From a memory consumption point of view it is also pretty equivalent. The reason that the way we use it generates small maps or hash-maps, the problem being the number of map/hash-map involved in the tree.
Definition at line 35 of file NAryTree.hh.
|
default |
Default constructor.
|
default |
Copy constructor (default)
other |
|
default |
Move constructor (default)
other |
|
default |
Destructor.
|
inline |
clear the tree
Definition at line 337 of file NAryTree.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::init().
|
inline |
begin | the starting iterator over a range of Nodes |
end | the ending iterator over a range of Nodes |
result | the Leaf that is associated to the nodes'range if it exists, undetermined otherwise |
Definition at line 324 of file NAryTree.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newState().
|
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.
begin | the starting iterator over a range of Nodes |
end | the ending iterator over a range of Nodes |
info | the piece of information that will be associated with the range in the tree |
Definition at line 304 of file NAryTree.hh.
Referenced by Diades::Utils::NAryTree< Node, Leaf, _Map >::TreeBranches::insertSuccessiveBranches(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newState().
|
default |
|
default |
|
private |
Definition at line 257 of file NAryTree.hh.