Basic tree structure.
More...
#include <SurgSim/DataStructures/Tree.h>
|
| | Tree () |
| | Constructor. After construction, the root is null. More...
|
| |
| virtual | ~Tree () |
| | Destructor. More...
|
| |
| 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
◆ Tree()
Constructor. After construction, the root is null.
◆ ~Tree()
◆ 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. |
◆ m_root
| std::shared_ptr<TreeNode> SurgSim::DataStructures::Tree::m_root |
|
private |
The documentation for this class was generated from the following files: