1 #ifndef GENESIS_TREE_TREE_SUBTREE_H_ 2 #define GENESIS_TREE_TREE_SUBTREE_H_ 95 :
link_( &node.primary_link() )
105 :
link_( use_primary ? &edge.primary_link() : &edge.secondary_link() )
175 #endif // include guard TreeNode const & node() const
Get the TreeNode at which the subtree starts.
TreeEdge & edge()
Return the TreeEdge of this TreeLink.
TreeNode & node()
Return the TreeNode of this TreeLink.
Subtree(TreeEdge const &edge, bool use_primary=false)
Construct a Subtree in one of the two directions of a given TreeEdge.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
Reference to a subtree of a Tree.
Subtree(TreeNode const &node)
Construct a Subtree representing the given TreeNode and the part of the Tree away from its root node...
Subtree(TreeLink const &link)
Construct a Subtree that contains all of the tree except for the part that the outer() link of the gi...
TreeEdge const & edge() const
Get the TreeEdge that separates the subtree from the rest of the tree.
TreeLink const & link() const
Get the TreeLink that separates the subtree from the rest of the tree.
Subtree & operator=(Subtree const &)=default
TreeLink const * link_
Return whether this subtree points to something, or was default constructed.
TreeLink & outer()
Return the TreeLink of the adjacent TreeNode.
void invert()
Invert/flip the subtree to represent the other (complementary) part of the tree.