A toolkit for working with phylogenetic data.
v0.19.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 58 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...
 
std::string dump () const
 Returns a one-line dump summary of the data of this edge. 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 72 of file edge.hpp.

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

Definition at line 79 of file edge.hpp.

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

Member Function Documentation

EdgeDataType& data ( )
inline

Definition at line 118 of file edge.hpp.

EdgeDataType const& data ( ) const
inline

Definition at line 124 of file edge.hpp.

EdgeDataType* data_cast ( )
inline

Definition at line 130 of file edge.hpp.

EdgeDataType const* data_cast ( ) const
inline

Definition at line 136 of file edge.hpp.

BaseEdgeData * data_ptr ( )

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 128 of file edge.cpp.

BaseEdgeData const * data_ptr ( ) const

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 139 of file edge.cpp.

std::string dump ( ) const

Returns a one-line dump summary of the data of this edge.

TODO this method assumes that the tree node has a name. not good.

Definition at line 215 of file edge.cpp.

bool has_data ( ) const

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

Definition at line 117 of file edge.cpp.

size_t index ( ) const

Return the index of this Edge.

Definition at line 45 of file edge.cpp.

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

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

Definition at line 53 of file edge.cpp.

TreeLink const & primary_link ( ) const

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

Definition at line 61 of file edge.cpp.

TreeNode & primary_node ( )

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

Definition at line 85 of file edge.cpp.

TreeNode const & primary_node ( ) const

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

Definition at line 93 of file edge.cpp.

TreeEdge & reset_data ( std::unique_ptr< BaseEdgeData data)

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 200 of file edge.cpp.

TreeEdge & reset_index ( size_t  val)

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 158 of file edge.cpp.

TreeEdge & reset_primary_link ( TreeLink val)

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 172 of file edge.cpp.

TreeEdge & reset_secondary_link ( TreeLink val)

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 186 of file edge.cpp.

TreeLink & secondary_link ( )

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

Definition at line 69 of file edge.cpp.

TreeLink const & secondary_link ( ) const

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

Definition at line 77 of file edge.cpp.

TreeNode & secondary_node ( )

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

Definition at line 101 of file edge.cpp.

TreeNode const & secondary_node ( ) const

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

Definition at line 109 of file edge.cpp.

Friends And Related Function Documentation

friend class Tree
friend

Definition at line 66 of file edge.hpp.


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