#include <genesis/tree/tree/edge.hpp>
Public Member Functions | |
TreeEdge () | |
TreeEdge (size_t index, TreeLink *primary_link, TreeLink *secondary_link) | |
TreeEdge (TreeEdge &&)=delete | |
TreeEdge (TreeEdge const &)=delete | |
~TreeEdge ()=default | |
template<class EdgeDataType > | |
EdgeDataType & | data () |
template<class EdgeDataType > | |
EdgeDataType const & | data () const |
template<class EdgeDataType > | |
EdgeDataType * | data_cast () |
template<class EdgeDataType > | |
EdgeDataType const * | data_cast () const |
template<class EdgeDataType > | |
bool | data_is (bool allow_null=false) const |
Return true iff the TreeEdge has a data object assigned to it that is of a particular given data type. More... | |
template<class EdgeDataType > | |
bool | data_is_derived_from (bool allow_null=false) const |
Return true iff the TreeEdge has a data object assigned to it that is derived from a particular given data type. More... | |
BaseEdgeData * | data_ptr () |
Return a pointer to the data. More... | |
BaseEdgeData const * | data_ptr () const |
Return a const pointer to the data. More... | |
bool | has_data () const |
Return true if the TreeEdge has a data object assigned to it. More... | |
size_t | index () const |
Return the index of this Edge. More... | |
TreeEdge & | operator= (TreeEdge &&)=delete |
TreeEdge & | operator= (TreeEdge const &)=delete |
TreeLink & | primary_link () |
Return the TreeLink of this TreeEdge that points towards the root. More... | |
TreeLink const & | primary_link () const |
Return the TreeLink of this TreeEdge that points towards the root. More... | |
TreeNode & | primary_node () |
Return the TreeNode of this TreeEdge that points towards the root. More... | |
TreeNode const & | primary_node () const |
Return the TreeNode of this TreeEdge that points towards the root. More... | |
TreeEdge & | reset_data (std::unique_ptr< BaseEdgeData > data) |
Reset the data pointer of this TreeEdge. More... | |
TreeEdge & | reset_index (size_t val) |
Reset the internal index of this TreeEdge. More... | |
TreeEdge & | reset_primary_link (TreeLink *val) |
Reset the internal pointer to the primary TreeLink of this TreeEdge. More... | |
TreeEdge & | reset_secondary_link (TreeLink *val) |
Reset the internal pointer to the secondary TreeLink of this TreeEdge. More... | |
TreeLink & | secondary_link () |
Return the TreeLink of this TreeEdge that points away from the root. More... | |
TreeLink const & | secondary_link () const |
Return the TreeLink of this TreeEdge that points away from the root. More... | |
TreeNode & | secondary_node () |
Return the TreeNode of this TreeEdge that points away from the root. More... | |
TreeNode const & | secondary_node () const |
Return the TreeNode of this TreeEdge that points away from the root. More... | |
Friends | |
class | Tree |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Reset the data pointer of this TreeEdge.
Using this function, a TreeEdge can be assigend new data. It is also possible to change the data type completely (as long as it derives from BaseEdgeData). Be however aware that many functions that work with Trees expect a certain data type. Thus, changing it might break those functions and lead to exceptions and other errors.
|
inline |
Reset the internal index of this TreeEdge.
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.
Reset the internal pointer to the primary TreeLink of this TreeEdge.
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.
Reset the internal pointer to the secondary TreeLink of this TreeEdge.
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.
|
inline |
|
inline |
|
inline |
|
inline |