FSM Library - C++ version
Tree.h
1 /*
2  * Copyright. GaĆ«l Dottel, Christoph Hilken, and Jan Peleska 2016 - 2021
3  *
4  * Licensed under the EUPL V.1.1
5  */
6 #ifndef FSM_TREES_TREE_H_
7 #define FSM_TREES_TREE_H_
8 
9 #include <algorithm>
10 #include <memory>
11 #include <vector>
12 
13 #include "fsm/InputTrace.h"
14 #include "interface/FsmPresentationLayer.h"
15 #include "trees/IOListContainer.h"
16 #include "trees/TreeEdge.h"
17 #include "trees/TreeNode.h"
18 
19 class Tree
20 {
21 protected:
25  std::shared_ptr<TreeNode> root;
26 
30  std::vector<std::shared_ptr<TreeNode>> leaves;
31 
35  const std::shared_ptr<FsmPresentationLayer> presentationLayer;
36 
40  void calcLeaves();
41 
42  //TODO
43  void remove(const std::shared_ptr<TreeNode> thisNode, const std::shared_ptr<TreeNode> otherNode);
44 
51  void printChildren(std::ostream & out, const std::shared_ptr<TreeNode> top, const std::shared_ptr<int> idNode) const;
52 public:
58  Tree(const std::shared_ptr<TreeNode> root, const std::shared_ptr<FsmPresentationLayer> presentationLayer);
59 
64  std::vector<std::shared_ptr<TreeNode>> getLeaves();
65 
70  std::shared_ptr<TreeNode> getRoot() const;
71 
72  //TODO
73  IOListContainer getIOLists();
74 
81  void remove(const std::shared_ptr<Tree> otherTree);
82 
87  void toDot(std::ostream & out);
88 
94 
100  void add(const IOListContainer & tcl);
101 
107  void addToRoot(const IOListContainer & tcl);
108 
113  void unionTree(const std::shared_ptr<Tree> otherTree);
114 
115  //TODO
116  void addAfter(const InputTrace & tr, const IOListContainer & cnt);
117 };
118 #endif //FSM_TREES_TREE_H_
std::vector< std::shared_ptr< TreeNode > > getLeaves()
Definition: Tree.cpp:44
void calcLeaves()
Definition: Tree.cpp:8
Definition: IOListContainer.h:15
void unionTree(const std::shared_ptr< Tree > otherTree)
Definition: Tree.cpp:100
std::shared_ptr< TreeNode > getRoot() const
Definition: Tree.cpp:50
std::vector< std::shared_ptr< TreeNode > > leaves
Definition: Tree.h:30
Definition: Tree.h:19
Tree(const std::shared_ptr< TreeNode > root, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
Definition: Tree.cpp:38
void add(const IOListContainer &tcl)
Definition: Tree.cpp:88
Definition: InputTrace.h:15
void printChildren(std::ostream &out, const std::shared_ptr< TreeNode > top, const std::shared_ptr< int > idNode) const
Definition: Tree.cpp:28
IOListContainer getTestCases()
Definition: Tree.cpp:83
const std::shared_ptr< FsmPresentationLayer > presentationLayer
Definition: Tree.h:35
void toDot(std::ostream &out)
Definition: Tree.cpp:73
std::shared_ptr< TreeNode > root
Definition: Tree.h:25
void addToRoot(const IOListContainer &tcl)
Definition: Tree.cpp:94