NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
CBioTree< TBioNode > Class Template Reference

Search Toolkit Book for CBioTree

Basic tree structure for biological applications. More...

#include <algo/phy_tree/bio_tree.hpp>

+ Inheritance diagram for CBioTree< TBioNode >:
+ Collaboration diagram for CBioTree< TBioNode >:

Classes

struct  CAssignTreeFunc
 Functor to reset tree pointer in all nodes. More...
 
class  CBioNode
 
class  CFindUidFunc
 Find node by UID functor. More...
 

Public Types

typedef CBioTree< TBioNode > TBioTree
 
typedef CBioNode TBioTreeNode
 Biotree node (forms the tree hierarchy) More...
 
typedef TBioNode TBioNodeType
 

Public Member Functions

 CBioTree ()
 
virtual ~CBioTree ()
 
 CBioTree (const CBioTree< TBioNode > &btr)
 
CBioTree< TBioNode > & operator= (const CBioTree< TBioNode > &btr)
 
const TBioTreeNodeFindNode (TBioTreeNodeId node_id) const
 Finds node by id. More...
 
void AddFeature (TBioTreeNode *node, TBioTreeFeatureId feature_id, const string &feature_value)
 Add feature to the tree node Function controls that the feature is registered in the feature dictionary of this tree. More...
 
void AddFeature (TBioTreeNode *node, const string &feature_name, const string &feature_value)
 Add feature to the tree node Function controls that the feature is registered in the feature dictionary of this tree. More...
 
virtual TBioTreeNodeId GetNodeId ()
 Get new unique node id. More...
 
virtual TBioTreeNodeId GetNodeId (const TBioTreeNode &)
 Get new unique node id (for cases when node id depends on the node's content. More...
 
void SetNodeId (TBioTreeNode *node)
 Assign new unique node id to the node. More...
 
void SetTreeNode (TBioTreeNode *node)
 Assign new top level tree node. More...
 
const TBioTreeNodeGetTreeNode () const
 
TBioTreeNodeGetTreeNodeNonConst ()
 
void DetachTreeNode ()
 
TBioTreeNodeAddNode (const TBioNodeType &node_value, TBioTreeNodeId parent_id)
 Add node to the tree (node location is defined by the parent id. More...
 
TBioTreeNodeAddNode (const TBioNodeType &node_value, TBioTreeNode *parent_node)
 Add a node to the tree when you have already looked up the parent node (faster) More...
 
void SetParentTree (CBioNode &node)
 Recursively set this tree as parent tree for the node. More...
 
void SetParentTree (CBioNode &node, CBioTree *tr)
 Recursively set parent tree for the node. More...
 
void Clear ()
 Clear the bio tree. More...
 
CBioTreeFeatureDictionaryGetFeatureDict ()
 Return feature dictionary. More...
 
const CBioTreeFeatureDictionaryGetFeatureDict () const
 Return feature dictionary. More...
 

Protected Attributes

CBioTreeFeatureDictionary m_FeatureDict
 
TBioTreeNodeId m_NodeIdCounter
 
unique_ptr< TBioTreeNodem_TreeNode
 Top level node. More...
 

Detailed Description

template<class TBioNode>
class CBioTree< TBioNode >

Basic tree structure for biological applications.

Definition at line 231 of file bio_tree.hpp.


The documentation for this class was generated from the following file:
Modified on Fri Sep 20 14:58:32 2024 by modify_doxy.py rev. 669887