A toolkit for working with phylogenetic data.
v0.20.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TreeEdge Class Reference

#include <genesis/tree/tree/edge.hpp>

Detailed Description

Definition at line 59 of file edge.hpp.

Public Member Functions

 TreeEdge ()
 
 TreeEdge (size_t index, TreeLink *primary_link, TreeLink *secondary_link)
 
 TreeEdge (TreeEdge const &)=delete
 
 TreeEdge (TreeEdge &&)=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
 
BaseEdgeDatadata_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...
 
TreeEdgeoperator= (TreeEdge const &)=delete
 
TreeEdgeoperator= (TreeEdge &&)=delete
 
TreeLinkprimary_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...
 
TreeNodeprimary_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...
 
TreeEdgereset_data (std::unique_ptr< BaseEdgeData > data)
 Reset the data pointer of this TreeEdge. More...
 
TreeEdgereset_index (size_t val)
 Reset the internal index of this TreeEdge. More...
 
TreeEdgereset_primary_link (TreeLink *val)
 Reset the internal pointer to the primary TreeLink of this TreeEdge. More...
 
TreeEdgereset_secondary_link (TreeLink *val)
 Reset the internal pointer to the secondary TreeLink of this TreeEdge. More...
 
TreeLinksecondary_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...
 
TreeNodesecondary_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
 

Constructor & Destructor Documentation

TreeEdge ( )
inline

Definition at line 73 of file edge.hpp.

TreeEdge ( size_t  index,
TreeLink primary_link,
TreeLink secondary_link 
)
inline

Definition at line 80 of file edge.hpp.

~TreeEdge ( )
default
TreeEdge ( TreeEdge const &  )
delete
TreeEdge ( TreeEdge &&  )
delete

Member Function Documentation

EdgeDataType& data ( )
inline

Definition at line 183 of file edge.hpp.

EdgeDataType const& data ( ) const
inline

Definition at line 189 of file edge.hpp.

EdgeDataType* data_cast ( )
inline

Definition at line 195 of file edge.hpp.

EdgeDataType const* data_cast ( ) const
inline

Definition at line 201 of file edge.hpp.

BaseEdgeData* data_ptr ( )
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 212 of file edge.hpp.

BaseEdgeData const* data_ptr ( ) const
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 223 of file edge.hpp.

bool has_data ( ) const
inline

Return true if the TreeEdge has a data object assigned to it.

Definition at line 177 of file edge.hpp.

size_t index ( ) const
inline

Return the index of this Edge.

Definition at line 105 of file edge.hpp.

TreeEdge& operator= ( TreeEdge const &  )
delete
TreeEdge& operator= ( TreeEdge &&  )
delete
TreeLink& primary_link ( )
inline

Return the TreeLink of this TreeEdge that points towards the root.

Definition at line 113 of file edge.hpp.

TreeLink const& primary_link ( ) const
inline

Return the TreeLink of this TreeEdge that points towards the root.

Definition at line 121 of file edge.hpp.

TreeNode& primary_node ( )
inline

Return the TreeNode of this TreeEdge that points towards the root.

Definition at line 145 of file edge.hpp.

TreeNode const& primary_node ( ) const
inline

Return the TreeNode of this TreeEdge that points towards the root.

Definition at line 153 of file edge.hpp.

TreeEdge& reset_data ( std::unique_ptr< BaseEdgeData data)
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.

Definition at line 284 of file edge.hpp.

TreeEdge& reset_index ( size_t  val)
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.

Definition at line 242 of file edge.hpp.

TreeEdge& reset_primary_link ( TreeLink val)
inline

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.

Definition at line 256 of file edge.hpp.

TreeEdge& reset_secondary_link ( TreeLink val)
inline

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.

Definition at line 270 of file edge.hpp.

TreeLink& secondary_link ( )
inline

Return the TreeLink of this TreeEdge that points away from the root.

Definition at line 129 of file edge.hpp.

TreeLink const& secondary_link ( ) const
inline

Return the TreeLink of this TreeEdge that points away from the root.

Definition at line 137 of file edge.hpp.

TreeNode& secondary_node ( )
inline

Return the TreeNode of this TreeEdge that points away from the root.

Definition at line 161 of file edge.hpp.

TreeNode const& secondary_node ( ) const
inline

Return the TreeNode of this TreeEdge that points away from the root.

Definition at line 169 of file edge.hpp.

Friends And Related Function Documentation

friend class Tree
friend

Definition at line 67 of file edge.hpp.


The documentation for this class was generated from the following file: