Basic tree structure.
More...
#include <Tree.h>
|
| Tree () |
| Constructor. After construction, the root is null.
|
|
virtual | ~Tree () |
| Destructor.
|
|
void | setRoot (std::shared_ptr< TreeNode > root) |
| Sets the root of the tree. More...
|
|
std::shared_ptr< TreeNode > | getRoot () const |
|
bool | operator== (const Tree &tree) const |
| If the trees are not of the same type, returns false; otherwise, compares with the implementation of isEqual(const Tree&). More...
|
|
bool | operator!= (const Tree &tree) const |
| If the trees are not of the same type, returns false; otherwise, compares with the implementation of isEqual(const Tree&). More...
|
|
|
virtual bool | isEqual (const Tree &tree) const |
| Recurses through the tree, starting at the root. More...
|
|
Basic tree structure.
The tree is composed of TreeNodes, which are all accessible from the root.
- See also
- TreeNode TreeData
§ getRoot()
std::shared_ptr< TreeNode > SurgSim::DataStructures::Tree::getRoot |
( |
| ) |
const |
- Returns
- The root of the tree.
§ isEqual()
bool Tree::isEqual |
( |
const Tree & |
tree | ) |
const |
|
protectedvirtual |
Recurses through the tree, starting at the root.
Override this method in derived classes to implement different comparisons.
- Parameters
-
tree | Other tree for comparison. |
- Returns
- true if the trees are equal; otherwise, returns false.
§ operator!=()
bool Tree::operator!= |
( |
const Tree & |
tree | ) |
const |
If the trees are not of the same type, returns false; otherwise, compares with the implementation of isEqual(const Tree&).
- Parameters
-
tree | Other tree for comparison. |
- Returns
- true if the trees are not equal; otherwise, returns false.
§ operator==()
bool Tree::operator== |
( |
const Tree & |
tree | ) |
const |
If the trees are not of the same type, returns false; otherwise, compares with the implementation of isEqual(const Tree&).
- Parameters
-
tree | Other tree for comparison. |
- Returns
- true if the trees are equal; otherwise, returns false.
§ setRoot()
void SurgSim::DataStructures::Tree::setRoot |
( |
std::shared_ptr< TreeNode > |
root | ) |
|
Sets the root of the tree.
- Parameters
-
root | The new root of the tree. |
The documentation for this class was generated from the following files:
- SurgSim/DataStructures/Tree.h
- SurgSim/DataStructures/Tree.cpp