robometry/TreeNode.h file

Namespaces

namespace robometry

Classes

template<class T>
class robometry::TreeNode
A class to represent the Node in Tree struct.

Functions

template<typename T>
auto addLeaf(matioCpp::Span<const std::string> nodes, std::shared_ptr<T> element, std::shared_ptr<TreeNode<T>> treeNode) -> bool
Add a new leaf in the tree.
template<typename T>
auto addLeaf(const std::string& name, std::shared_ptr<T> element, std::shared_ptr<TreeNode<T>> treeNode) -> bool
Add a new leaf in the tree.
template<typename T>
auto getLeaf(matioCpp::Span<const std::string> nodes, std::shared_ptr<TreeNode<T>> treeNode) -> std::weak_ptr<TreeNode<T>>
Get the leaf from a node.
template<typename T>
auto getLeaf(const std::string& name, std::shared_ptr<TreeNode<T>> treeNode) -> std::weak_ptr<TreeNode<T>>
Get the leaf from a node.

Function documentation

template<typename T>
bool addLeaf(matioCpp::Span<const std::string> nodes, std::shared_ptr<T> element, std::shared_ptr<TreeNode<T>> treeNode)

Add a new leaf in the tree.

Parameters
nodes in A span representing a list of nodes
element in The value stored by the leaf
treeNode in a pointer to a tree node
Returns True in case of success false otherwise

template<typename T>
bool addLeaf(const std::string& name, std::shared_ptr<T> element, std::shared_ptr<TreeNode<T>> treeNode)

Add a new leaf in the tree.

Parameters
name in A string containing the address of the leaf. Use the TreeNode<T>::stringSeparator to define multiple nodes
element in The content of the leaf
treeNode in a pointer to a tree node
Returns True in case of success false otherwise

template<typename T>
std::weak_ptr<TreeNode<T>> getLeaf(matioCpp::Span<const std::string> nodes, std::shared_ptr<TreeNode<T>> treeNode)

Get the leaf from a node.

Parameters
nodes in A span representing a list of nodes
treeNode in a pointer to a tree node
Returns A pointer to TreeNode, if the child is not found the weak pointer cannot be locked.

template<typename T>
std::weak_ptr<TreeNode<T>> getLeaf(const std::string& name, std::shared_ptr<TreeNode<T>> treeNode)

Get the leaf from a node.

Parameters
name in A string containing the address of the leaf. Use the TreeNode<T>::stringSeparator to define multiple nodes
treeNode in a pointer to a tree node
Returns A pointer to TreeNode, if the child is not found the weak pointer cannot be locked.