NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
tree< T, tree_node_allocator > Class Template Reference

Search Toolkit Book for tree

#include <algo/structure/cd_utils/tree_msvc7.hpp>

+ Inheritance diagram for tree< T, tree_node_allocator >:
+ Collaboration diagram for tree< T, tree_node_allocator >:

Classes

class  compare_nodes
 
class  fixed_depth_iterator
 
class  iterator_base
 
class  iterator_base_less
 
class  post_order_iterator
 
class  pre_order_iterator
 
class  sibling_iterator
 

Public Types

typedef tree_node_< Ttree_node
 
typedef T value_type
 
typedef pre_order_iterator iterator
 

Public Member Functions

 tree ()
 
 tree (const T &)
 
 tree (const iterator_base &)
 
 tree (const tree< T, tree_node_allocator > &)
 
 ~tree ()
 
void operator= (const tree< T, tree_node_allocator > &)
 
pre_order_iterator begin () const
 
pre_order_iterator end () const
 
post_order_iterator begin_post () const
 
post_order_iterator end_post () const
 
fixed_depth_iterator begin_fixed (const iterator_base &, unsigned int) const
 
fixed_depth_iterator end_fixed (const iterator_base &, unsigned int) const
 
sibling_iterator begin (const iterator_base &) const
 
sibling_iterator end (const iterator_base &) const
 
template<typename iter >
iter parent (iter) const
 
sibling_iterator previous_sibling (const iterator_base &) const
 
sibling_iterator next_sibling (const iterator_base &) const
 
void clear ()
 
template<typename iter >
iter erase (iter)
 
void erase_children (const iterator_base &)
 
template<typename iter >
iter append_child (iter position)
 
template<typename iter >
iter append_child (iter position, const T &x)
 
template<typename iter >
iter append_child (iter position, iter other_position)
 
template<typename iter >
iter append_children (iter position, sibling_iterator from, sibling_iterator to)
 
pre_order_iterator set_head (const T &x)
 
template<typename iter >
iter insert (iter position, const T &x)
 
sibling_iterator insert (sibling_iterator position, const T &x)
 
template<typename iter >
iter insert_subtree (iter position, const iterator_base &subtree)
 
template<typename iter >
iter insert_after (iter position, const T &x)
 
template<typename iter >
iter replace (iter position, const T &x)
 
template<typename iter >
iter replace (iter position, const iterator_base &from)
 
sibling_iterator replace (sibling_iterator orig_begin, sibling_iterator orig_end, sibling_iterator new_begin, sibling_iterator new_end)
 
template<typename iter >
iter flatten (iter position)
 
template<typename iter >
iter reparent (iter position, sibling_iterator begin, sibling_iterator end)
 
template<typename iter >
iter reparent (iter position, iter from)
 
template<typename iter >
iter move_after (iter target, iter source)
 
template<typename iter >
iter move_before (iter target, iter source)
 
template<typename iter >
iter move_below (iter target, iter source)
 
void merge (sibling_iterator, sibling_iterator, sibling_iterator, sibling_iterator, bool duplicate_leaves=false)
 
void sort (sibling_iterator from, sibling_iterator to, bool deep=false)
 
template<class StrictWeakOrdering >
void sort (sibling_iterator from, sibling_iterator to, StrictWeakOrdering comp, bool deep=false)
 
template<typename iter >
bool equal (const iter &one, const iter &two, const iter &three) const
 
template<typename iter , class BinaryPredicate >
bool equal (const iter &one, const iter &two, const iter &three, BinaryPredicate) const
 
template<typename iter >
bool equal_subtree (const iter &one, const iter &two) const
 
template<typename iter , class BinaryPredicate >
bool equal_subtree (const iter &one, const iter &two, BinaryPredicate) const
 
tree subtree (sibling_iterator from, sibling_iterator to) const
 
void subtree (tree &, sibling_iterator from, sibling_iterator to) const
 
void swap (sibling_iterator it)
 
int size () const
 
bool empty () const
 
int depth (const iterator_base &) const
 
unsigned int number_of_children (const iterator_base &) const
 
unsigned int number_of_siblings (const iterator_base &) const
 
bool is_in_subtree (const iterator_base &position, const iterator_base &begin, const iterator_base &end) const
 
bool is_valid (const iterator_base &) const
 
unsigned int index (sibling_iterator it) const
 
sibling_iterator child (const iterator_base &position, unsigned int) const
 
tree reroot (iterator newRoot)
 

Public Attributes

tree_nodehead
 
tree_nodefeet
 

Private Member Functions

void head_initialise_ ()
 
void copy_ (const tree< T, tree_node_allocator > &other)
 

Private Attributes

tree_node_allocator alloc_
 

Detailed Description

template<class T, class tree_node_allocator = std::allocator<tree_node_<T> >>
class tree< T, tree_node_allocator >

Definition at line 89 of file tree_msvc7.hpp.

Member Typedef Documentation

◆ iterator

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
typedef pre_order_iterator tree< T, tree_node_allocator >::iterator

Definition at line 173 of file tree_msvc7.hpp.

◆ tree_node

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
typedef tree_node_<T> tree< T, tree_node_allocator >::tree_node

Definition at line 92 of file tree_msvc7.hpp.

◆ value_type

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
typedef T tree< T, tree_node_allocator >::value_type

Definition at line 93 of file tree_msvc7.hpp.

Constructor & Destructor Documentation

◆ tree() [1/4]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::tree

◆ tree() [2/4]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::tree ( const T x)

◆ tree() [3/4]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::tree ( const iterator_base other)

◆ tree() [4/4]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::tree ( const tree< T, tree_node_allocator > &  other)

◆ ~tree()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::~tree

Member Function Documentation

◆ append_child() [1/3]

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::append_child ( iter  position)

◆ append_child() [2/3]

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::append_child ( iter  position,
const T x 
)

◆ append_child() [3/3]

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::append_child ( iter  position,
iter  other_position 
)

◆ append_children()

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::append_children ( iter  position,
sibling_iterator  from,
sibling_iterator  to 
)

Definition at line 742 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::insert_subtree().

◆ begin() [1/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::pre_order_iterator tree< T, tree_node_allocator >::begin ( void  ) const

Definition at line 573 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::head, and tree_node_< T >::next_sibling.

Referenced by SeqTree::addSelectionFields(), SeqTreeRootedLayout::calculateNodePositions(), SeqTree::clearInternalNodeSelection(), NJ_TreeAlgorithm::ComputeTree(), SLC_TreeAlgorithm::ComputeTree(), CDFamily::convergeTo(), SeqTreeAsnizer::convertToAsnSeqTree(), SeqTreeAsnizer::convertToSeqTree(), tree< T, tree_node_allocator >::copy_(), tree< T, tree_node_allocator >::empty(), tree< T, tree_node_allocator >::equal_subtree(), CDFamily::findCD(), CDFamily::findCDByAccession(), SeqTreeRootedLayout::findEdgeEnd(), SeqTree::fixRowName(), SeqTree::fixRowNumber(), CDFamily::getAllCD(), SeqTreeAPI::getAllEdges(), CDFamily::getCdsNotOnPathToRoot(), CDFamily::getChildren(), SeqTree::getDistantNodes(), SeqTree::getDiversityRankToRow(), GetMaxPath(), CDFamily::getNewickRepresentation(), CDFamily::getSelectedCDs(), SeqTree::getSequenceComposition(), CDFamily::inspect(), tree< T, tree_node_allocator >::is_in_subtree(), SeqTreeAPI::loadAndValidateExistingTree(), TreeAlgorithm::midpointRootIfNeeded(), MidpointRootSeqTree(), SeqTree::prepare(), CdTreeStream::read(), tree< T, tree_node_allocator >::reparent(), s_AnalyzeLibraryOrder(), s_CTreeNew(), s_SaveHSP(), CDFamily::selectAllCDs(), CDFamily::selectCDs(), MultipleAlignment::setAlignment(), CDFamily::setRootCD(), tree< T, tree_node_allocator >::size(), tree< T, tree_node_allocator >::sort(), CdTreeStream::toString(), tree< T, tree_node_allocator >::tree(), SeqTree::uncollapseAll(), SeqTree::updateSeqCounts(), and CdTreeStream::writeToFile().

◆ begin() [2/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::begin ( const iterator_base pos) const

◆ begin_fixed()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::fixed_depth_iterator tree< T, tree_node_allocator >::begin_fixed ( const iterator_base pos,
unsigned int  dp 
) const

Definition at line 602 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::iterator_base::node, and tmp.

◆ begin_post()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::post_order_iterator tree< T, tree_node_allocator >::begin_post

◆ child()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::child ( const iterator_base position,
unsigned int  num 
) const

◆ clear()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::clear ( void  )

◆ copy_()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::copy_ ( const tree< T, tree_node_allocator > &  other)
private

◆ depth()

template<class T , class tree_node_allocator >
int tree< T, tree_node_allocator >::depth ( const iterator_base it) const

◆ empty()

template<class T , class tree_node_allocator >
bool tree< T, tree_node_allocator >::empty

◆ end() [1/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::pre_order_iterator tree< T, tree_node_allocator >::end ( void  ) const

Definition at line 579 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::feet.

Referenced by CDFamily::addChild(), CProjectTreeBuilder::AddDatatoolSourcesDepends(), SeqTree::addSelectionFields(), AnalyzeDllData(), CCyclicDepends::AnalyzeProjItem(), CCyclicDepends::AnalyzeProjItemNew(), tree< T, tree_node_allocator >::begin(), SeqTree::clearInternalNodeSelection(), CPreBuildEventTool::CommandLine(), CDFamily::convergeTo(), SeqTreeAsnizer::convertToAsnSeqTree(), tree< T, tree_node_allocator >::copy_(), CreateDllBuildTree(), SAsnProjectSingleT::DoCreate(), SAsnProjectMultipleT::DoCreate(), SAppProjectT::DoCreate(), SLibProjectT::DoCreate(), SDllProjectT::DoCreate(), SMsvcProjectT::DoCreate(), tree< T, tree_node_allocator >::empty(), tree< T, tree_node_allocator >::equal_subtree(), CCyclicDepends::ExtendChains(), CDFamily::findCD(), CDFamily::findCDByAccession(), SeqTreeRootedLayout::findEdgeEnd(), CDFamily::findFamily(), SeqTree::fixRowName(), SeqTree::fixRowNumber(), CDFamily::getAllCD(), CDFamily::getCdsNotOnPathToRoot(), CDFamily::getChildren(), CDFamily::getClassicalParent(), SeqTree::getLeafById(), GetMaxPath(), CDFamily::getPathToRoot(), CDFamily::getSelectedCDs(), SeqTree::getSequenceComposition(), CDFamily::inspect(), tree< T, tree_node_allocator >::is_in_subtree(), CDFamily::isDup(), TreeAlgorithm::midpointRootIfNeeded(), MidpointRootSeqTree(), tree< T, tree_node_allocator >::next_sibling(), CDFamily::removeChild(), tree< T, tree_node_allocator >::reparent(), s_AnalyzeLibraryOrder(), s_CTreeNew(), s_IsInTree(), s_ReportDependenciesStatus(), s_SaveHSP(), CDFamily::selectAllCDs(), CDFamily::selectCDs(), CDFamily::setRootCD(), tree< T, tree_node_allocator >::size(), tree< T, tree_node_allocator >::sort(), SeqTree::uncollapseAll(), SeqTree::updateSeqCounts(), and CProjectTreeBuilder::VerifyBuildOrder().

◆ end() [2/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::end ( const iterator_base pos) const

◆ end_fixed()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::fixed_depth_iterator tree< T, tree_node_allocator >::end_fixed ( const iterator_base pos,
unsigned int  dp 
) const

Definition at line 619 of file tree_msvc7.hpp.

References assert, tree< T, tree_node_allocator >::iterator_base::node, and tmp.

◆ end_post()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::post_order_iterator tree< T, tree_node_allocator >::end_post

Definition at line 596 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::feet.

◆ equal() [1/2]

template<class T , class tree_node_allocator >
template<typename iter >
bool tree< T, tree_node_allocator >::equal ( const iter &  one,
const iter &  two,
const iter &  three 
) const

Definition at line 1180 of file tree_msvc7.hpp.

Referenced by tree< T, tree_node_allocator >::equal_subtree().

◆ equal() [2/2]

template<class T , class tree_node_allocator >
template<typename iter , class BinaryPredicate >
bool tree< T, tree_node_allocator >::equal ( const iter &  one,
const iter &  two,
const iter &  three,
BinaryPredicate  fun 
) const

◆ equal_subtree() [1/2]

template<class T , class tree_node_allocator >
template<typename iter >
bool tree< T, tree_node_allocator >::equal_subtree ( const iter &  one,
const iter &  two 
) const

Definition at line 1188 of file tree_msvc7.hpp.

◆ equal_subtree() [2/2]

template<class T , class tree_node_allocator >
template<typename iter , class BinaryPredicate >
bool tree< T, tree_node_allocator >::equal_subtree ( const iter &  one,
const iter &  two,
BinaryPredicate  fun 
) const

◆ erase()

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::erase ( iter  it)

◆ erase_children()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::erase_children ( const iterator_base it)

◆ flatten()

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::flatten ( iter  position)

Definition at line 973 of file tree_msvc7.hpp.

References tmp.

◆ head_initialise_()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::head_initialise_
private

◆ index()

template<class T , class tree_node_allocator >
unsigned int tree< T, tree_node_allocator >::index ( sibling_iterator  it) const

◆ insert() [1/2]

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::insert ( iter  position,
const T x 
)

◆ insert() [2/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::insert ( sibling_iterator  position,
const T x 
)

◆ insert_after()

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::insert_after ( iter  position,
const T x 
)

Definition at line 814 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::alloc_, kp::constructor(), and tmp.

◆ insert_subtree()

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::insert_subtree ( iter  position,
const iterator_base subtree 
)

◆ is_in_subtree()

template<class T , class tree_node_allocator >
bool tree< T, tree_node_allocator >::is_in_subtree ( const iterator_base position,
const iterator_base begin,
const iterator_base end 
) const

◆ is_valid()

template<class T , class tree_node_allocator >
bool tree< T, tree_node_allocator >::is_valid ( const iterator_base it) const

◆ merge()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::merge ( sibling_iterator  to1,
sibling_iterator  to2,
sibling_iterator  from1,
sibling_iterator  from2,
bool  duplicate_leaves = false 
)

◆ move_after()

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
template<typename iter >
iter tree< T, tree_node_allocator >::move_after ( iter  target,
iter  source 
)

◆ move_before()

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::move_before ( iter  target,
iter  source 
)

◆ move_below()

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
template<typename iter >
iter tree< T, tree_node_allocator >::move_below ( iter  target,
iter  source 
)

◆ next_sibling()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::next_sibling ( const iterator_base position) const

◆ number_of_children()

template<class T , class tree_node_allocator >
unsigned int tree< T, tree_node_allocator >::number_of_children ( const iterator_base it) const

◆ number_of_siblings()

template<class T , class tree_node_allocator >
unsigned int tree< T, tree_node_allocator >::number_of_siblings ( const iterator_base it) const

◆ operator=()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::operator= ( const tree< T, tree_node_allocator > &  other)

Definition at line 486 of file tree_msvc7.hpp.

References tree< T, tree_node_allocator >::copy_().

◆ parent()

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::parent ( iter  position) const

◆ previous_sibling()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::previous_sibling ( const iterator_base position) const

◆ reparent() [1/2]

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::reparent ( iter  position,
iter  from 
)

◆ reparent() [2/2]

template<class T , class tree_node_allocator >
template<typename iter >
iter tree< T, tree_node_allocator >::reparent ( iter  position,
sibling_iterator  begin,
sibling_iterator  end 
)

◆ replace() [1/3]

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::replace ( iter  position,
const iterator_base from 
)

◆ replace() [2/3]

template<class T , class tree_node_allocator >
template<class iter >
iter tree< T, tree_node_allocator >::replace ( iter  position,
const T x 
)

◆ replace() [3/3]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::sibling_iterator tree< T, tree_node_allocator >::replace ( sibling_iterator  orig_begin,
sibling_iterator  orig_end,
sibling_iterator  new_begin,
sibling_iterator  new_end 
)

◆ reroot()

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
tree tree< T, tree_node_allocator >::reroot ( iterator  newRoot)
inline

◆ set_head()

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator >::pre_order_iterator tree< T, tree_node_allocator >::set_head ( const T x)

◆ size()

template<class T , class tree_node_allocator >
int tree< T, tree_node_allocator >::size ( void  ) const

◆ sort() [1/2]

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::sort ( sibling_iterator  from,
sibling_iterator  to,
bool  deep = false 
)

Definition at line 1112 of file tree_msvc7.hpp.

Referenced by tree< T, tree_node_allocator >::sort().

◆ sort() [2/2]

template<class T , class tree_node_allocator >
template<class StrictWeakOrdering >
void tree< T, tree_node_allocator >::sort ( sibling_iterator  from,
sibling_iterator  to,
StrictWeakOrdering  comp,
bool  deep = false 
)

◆ subtree() [1/2]

template<class T , class tree_node_allocator >
tree< T, tree_node_allocator > tree< T, tree_node_allocator >::subtree ( sibling_iterator  from,
sibling_iterator  to 
) const

◆ subtree() [2/2]

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::subtree ( tree< T, tree_node_allocator > &  tmp,
sibling_iterator  from,
sibling_iterator  to 
) const

Definition at line 1234 of file tree_msvc7.hpp.

References tmp.

◆ swap()

template<class T , class tree_node_allocator >
void tree< T, tree_node_allocator >::swap ( sibling_iterator  it)

Member Data Documentation

◆ alloc_

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
tree_node_allocator tree< T, tree_node_allocator >::alloc_
private

◆ feet

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
tree_node * tree< T, tree_node_allocator >::feet

◆ head

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>
tree_node* tree< T, tree_node_allocator >::head

The documentation for this class was generated from the following file:
Modified on Fri Dec 01 04:50:36 2023 by modify_doxy.py rev. 669887