|
void | add (std::vector< int >::const_iterator lstIte, const std::vector< int >::const_iterator end) |
|
void TreeNode::add |
( |
const std::shared_ptr< TreeEdge > |
edge | ) |
|
Add and edge to this node children
- Parameters
-
std::shared_ptr< TreeNode > TreeNode::add |
( |
const int |
x | ) |
|
Conditional addition of a new edge emanating from this node: If an edge labelled by x already exists, nothing is changed, otherwise a new edge is created, and a new leaf node is returned
- Parameters
-
- Returns
- existing target node under this input, if no new edge has been created, or the new leaf node, if a new edge has been created.
First delegate the work to the children, then append each input sequence in tcl to this node, using the special strategy of the add(lstIte) operation
- Parameters
-
Append each input sequence in tcl to this node, using the special strategy of the add(lstIte) operation
- Parameters
-
std::shared_ptr< TreeNode > TreeNode::after |
( |
std::vector< int >::const_iterator |
lstIte, |
|
|
const std::vector< int >::const_iterator |
end |
|
) |
| |
Return target TreeNode reached after following the inputs from a given trace in the Tree.
- Parameters
-
lstIte | Iterator pointing to an element of an InputTrace |
end | Iterator pointing to the last element of an InputTrace |
- Returns
- nullptr if the input trace does not match with any path in the tree TreeNode reached after having successfully matched the whole input trace against the tree.
void TreeNode::calcLeaves |
( |
std::vector< std::shared_ptr< TreeNode >> & |
leaves | ) |
|
Calc the list of leaves of this tree
- Parameters
-
leaves | An empty list, it will be used to insert the leaves |
void TreeNode::deleteNode |
( |
| ) |
|
Mark this node as deleted. If this is a leaf node, remove it from the parent's list of children. If the parent becomes a leaf as an effect of this operation and if the parent is also marked as deleted, remove it as well. This is continued recursively.
std::shared_ptr< std::vector< std::shared_ptr< TreeEdge > > > TreeNode::getChildren |
( |
| ) |
const |
Getter for the children
- Returns
- The children
int TreeNode::getIO |
( |
const std::shared_ptr< TreeNode > |
node | ) |
const |
Get the input needed to reach a tree node from this one (the node need to be reacheable in one step)
- Parameters
-
node | The node to be searched into the tree node's children target |
- Returns
- The input needed to reach the tree node
std::weak_ptr< TreeNode > TreeNode::getParent |
( |
| ) |
const |
Getter for the parent
- Returns
- The parent
std::vector< int > TreeNode::getPath |
( |
| ) |
|
Get the inputs needed to reach this specific tree node
- Returns
- The path
std::shared_ptr< TreeEdge > TreeNode::hasEdge |
( |
const std::shared_ptr< TreeEdge > |
edge | ) |
const |
Check whether or not this tree node has a specific edge or not
- Parameters
-
edge | The edge to be searched into the tree node's children |
- Returns
- The tree edge if found, nullptr otherwise
bool TreeNode::isDeleted |
( |
| ) |
const |
Check whether or not this node is deleted
- Returns
- true if this node have been deleted, false otherwise
bool TreeNode::isLeaf |
( |
| ) |
const |
Check whether or not this tree node had any child or not
- Returns
- true if it is a leaf, false otherwise
void TreeNode::remove |
( |
const std::shared_ptr< TreeNode > |
node | ) |
|
Remove a tree node from this node's children target
- Parameters
-
void TreeNode::setParent |
( |
const std::weak_ptr< TreeNode > |
parent | ) |
|
Set the node to this one parent
- Parameters
-
pparent | The node which will be the parent of this one |
bool TreeNode::superTreeOf |
( |
const std::shared_ptr< TreeNode > |
otherNode | ) |
const |
Compare with an other three node to see if it is a super tree of this one or not
- Parameters
-
otherNode | The other tree node to compare |
- Returns
- true if the other tree node is a super tree of this one, false otherwise
Compare two tree node to check if they are the same or not
- Parameters
-
treeNode1 | The first tree node to compare |
treeNode2 | The second tree node to compare |
- Returns
- true if they are the same, false otherwise
std::shared_ptr<std::vector<std::shared_ptr<TreeEdge> > > TreeNode::children |
|
protected |
A list containing the children of this node
Mark this node as deleted
std::weak_ptr<TreeNode> TreeNode::parent |
|
protected |
The documentation for this class was generated from the following files:
- /Users/janpeleska/SharedFoldersWin/fsmlib-cpp/src/trees/TreeNode.h
- /Users/janpeleska/SharedFoldersWin/fsmlib-cpp/src/trees/TreeNode.cpp