#include <genesis/tree/tree/node.hpp>
Definition at line 58 of file tree/tree/node.hpp.
Public Member Functions | |
TreeNode () | |
TreeNode (size_t index, TreeLink *primary_link) | |
TreeNode (TreeNode &&)=delete | |
TreeNode (TreeNode const &)=delete | |
~TreeNode ()=default | |
template<class NodeDataType > | |
NodeDataType & | data () |
template<class NodeDataType > | |
NodeDataType const & | data () const |
template<class NodeDataType > | |
NodeDataType * | data_cast () |
template<class NodeDataType > | |
NodeDataType const * | data_cast () const |
template<class NodeDataType > | |
bool | data_is (bool allow_null=false) const |
Return true iff the TreeNode has a data object assigned to it that is of a particular given data type. More... | |
template<class NodeDataType > | |
bool | data_is_derived_from (bool allow_null=false) const |
Return true iff the TreeNode has a data object assigned to it that is derived from a particular given data type. More... | |
BaseNodeData * | data_ptr () |
Return a pointer to the data. More... | |
BaseNodeData const * | data_ptr () const |
Return a const pointer to the data. More... | |
bool | has_data () const |
Return true if the TreeNode has a data object assigned to it. More... | |
size_t | index () const |
Return the index of this Node. More... | |
TreeLink & | link () |
Return the TreeLink that points towards the root. More... | |
TreeLink const & | link () const |
Return the TreeLink that points towards the root. More... | |
TreeNode & | operator= (TreeNode &&)=delete |
TreeNode & | operator= (TreeNode const &)=delete |
TreeEdge & | primary_edge () |
Return the TreeEdge that points towards the root. More... | |
TreeEdge const & | primary_edge () const |
Return the TreeEdge that points towards the root. More... | |
TreeLink & | primary_link () |
Return the TreeLink that points towards the root. More... | |
TreeLink const & | primary_link () const |
Return the TreeLink that points towards the root. More... | |
TreeNode & | reset_data (std::unique_ptr< BaseNodeData > data) |
Reset the data pointer of this TreeNode. More... | |
TreeNode & | reset_index (size_t val) |
Reset the internal index of this TreeNode. More... | |
TreeNode & | reset_primary_link (TreeLink *val) |
Reset the internal pointer to the TreeLink of this TreeNode. More... | |
Friends | |
class | Tree |
|
inline |
Definition at line 72 of file tree/tree/node.hpp.
Definition at line 78 of file tree/tree/node.hpp.
|
default |
|
inline |
Definition at line 203 of file tree/tree/node.hpp.
|
inline |
Definition at line 209 of file tree/tree/node.hpp.
|
inline |
Definition at line 215 of file tree/tree/node.hpp.
|
inline |
Definition at line 221 of file tree/tree/node.hpp.
|
inline |
Return true
iff the TreeNode has a data object assigned to it that is of a particular given data type.
Definition at line 178 of file tree/tree/node.hpp.
|
inline |
Return true
iff the TreeNode has a data object assigned to it that is derived from a particular given data type.
Definition at line 193 of file tree/tree/node.hpp.
|
inline |
Return a pointer to the data.
In most cases, using data<>() is more convenient. However, in some cases, this function might be necessary.
Definition at line 232 of file tree/tree/node.hpp.
|
inline |
Return a const pointer to the data.
In most cases, using data<>() is more convenient. However, in some cases, this function might be necessary.
Definition at line 243 of file tree/tree/node.hpp.
|
inline |
Return true
if the TreeNode has a data object assigned to it.
Definition at line 168 of file tree/tree/node.hpp.
|
inline |
Return the index of this Node.
Definition at line 102 of file tree/tree/node.hpp.
|
inline |
Return the TreeLink that points towards the root.
This is just an alias for primary_link(), that is shorter to use when needed frequently in an algorithm.
Definition at line 129 of file tree/tree/node.hpp.
|
inline |
Return the TreeLink that points towards the root.
This is just an alias for primary_link(), that is shorter to use when needed frequently in an algorithm.
Definition at line 140 of file tree/tree/node.hpp.
|
inline |
Return the TreeEdge that points towards the root.
Definition at line 148 of file tree/tree/node.hpp.
|
inline |
Return the TreeEdge that points towards the root.
Definition at line 156 of file tree/tree/node.hpp.
|
inline |
Return the TreeLink that points towards the root.
Definition at line 110 of file tree/tree/node.hpp.
|
inline |
Return the TreeLink that points towards the root.
Definition at line 118 of file tree/tree/node.hpp.
|
inline |
Reset the data pointer of this TreeNode.
Using this function, a TreeNode can be assigend new data. It is also possible to change the data type completely (as long as it derives from BaseNodeData). Be however aware that many functions that work with trees expcet a certain data type. Thus, changing it might break those functions and lead to exceptions and other errors.
Definition at line 290 of file tree/tree/node.hpp.
|
inline |
Reset the internal index of this TreeNode.
This is a helper function that needs to be used with care and only in cases where appropriate. The index is an invariant that needs to be kept, as it needs to match the index in the Tree container.
This function exists to allow building and modifying a Tree without the need for many friend declarations. However, the function should rarely be needed outside of this context.
Definition at line 262 of file tree/tree/node.hpp.
Reset the internal pointer to the TreeLink of this TreeNode.
This is a helper function that needs to be used with care and only in cases where appropriate.
This function exists to allow building and modifying a Tree without the need for many friend declarations. However, the function should rarely be needed outside of this context.
Definition at line 276 of file tree/tree/node.hpp.
|
friend |
Definition at line 66 of file tree/tree/node.hpp.