NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CTreeNode< TValue, TKeyGetter > Struct Template Reference

Search Toolkit Book for CTreeNode

definition of a Culling tree More...

#include <corelib/ncbi_tree.hpp>

+ Inheritance diagram for CTreeNode< TValue, TKeyGetter >:
+ Collaboration diagram for CTreeNode< TValue, TKeyGetter >:

Classes

class  CSorter
 

Public Types

enum  EDeletePolicy { eDelete, eNoDelete }
 Whether to destroy the sub-nodes when bulk-cleaning the node. More...
 
enum  ENodeSearchType { eImmediateSubNodes = (1 << 0), eTopLevelNodes = (1 << 1), eAllUpperSubNodes = (1 << 2), eImmediateAndTop = (eImmediateSubNodes | eTopLevelNodes) }
 Parameters for node search by key. More...
 
enum  ECountNodes { fOnlyLeafs = (1 << 0), fCumulative = (1 << 1) }
 How to count nodes in the tree of which this node is a root. More...
 
typedef TValue TValueType
 
typedef TKeyGetter::TKeyType TKeyType
 
typedef CTreeNode< TValue, TKeyGetter > TTreeType
 
typedef list< TTreeType * > TNodeList
 
typedef list< const TTreeType * > TConstNodeList
 
typedef TNodeList::iterator TNodeList_I
 
typedef TNodeList::const_iterator TNodeList_CI
 
typedef TNodeList::reverse_iterator TNodeList_RI
 
typedef TNodeList::const_reverse_iterator TNodeList_CRI
 
typedef list< TKeyTypeTKeyList
 
typedef int TNodeSearchMode
 Bitwise mask of ENodeSearchType. More...
 
typedef int TCountNodes
 Bitwise mask of ECountNodes. More...
 

Public Member Functions

 CTreeNode (const TValue &value=TValue())
 Tree node construction. More...
 
 ~CTreeNode ()
 
 CTreeNode (const TTreeType &tree)
 
CTreeNodeoperator= (const TTreeType &tree)
 
const TTreeTypeGetParent (void) const
 Get node's parent. More...
 
TTreeTypeGetParent (void)
 Get node's parent. More...
 
const TTreeTypeGetRoot (void) const
 Get the topmost node. More...
 
TTreeTypeGetRoot (void)
 Get the topmost node. More...
 
TNodeList_CI SubNodeBegin (void) const
 Return first const iterator on subnode list. More...
 
TNodeList_I SubNodeBegin (void)
 Return first iterator on subnode list. More...
 
TNodeList_CI SubNodeEnd (void) const
 Return last const iterator on subnode list. More...
 
TNodeList_I SubNodeEnd (void)
 Return last iterator on subnode list. More...
 
TNodeList_CRI SubNodeRBegin (void) const
 Return first const reverse iterator on subnode list. More...
 
TNodeList_RI SubNodeRBegin (void)
 Return first reverse iterator on subnode list. More...
 
TNodeList_CRI SubNodeREnd (void) const
 Return last const reverse iterator on subnode list. More...
 
TNodeList_RI SubNodeREnd (void)
 Return last reverse iterator on subnode list. More...
 
const TValue & GetValue (void) const
 Return node's value. More...
 
TValue & GetValue (void)
 Return node's value. More...
 
void SetValue (const TValue &value)
 Set value for the node. More...
 
const TValue & operator* (void) const
 
TValue & operator* (void)
 
const TValue * operator-> (void) const
 
TValue * operator-> (void)
 
const TKeyTypeGetKey (void) const
 
TKeyTypeGetKey (void)
 
void RemoveNode (TTreeType *subnode)
 Remove subnode of the current node. More...
 
void RemoveNode (TNodeList_I it)
 Remove subnode of the current node. More...
 
void RemoveAllSubNodes (EDeletePolicy del=eDelete)
 Remove all immediate subnodes. More...
 
TTreeTypeDetachNode (TTreeType *subnode)
 Remove the subtree from the tree without destroying it. More...
 
TTreeTypeDetachNode (TNodeList_I it)
 Remove the subtree from the tree without destroying it. More...
 
void AddNode (TTreeType *subnode)
 Add new subnode. More...
 
TTreeTypeAddNode (const TValue &val=TValue())
 Add new subnode whose value is (a copy of) val. More...
 
void MoveSubnodes (TTreeType *src_tree_node)
 Remove all subnodes from the source node and attach them to the current tree (node). More...
 
void InsertNode (TNodeList_I it, TTreeType *subnode)
 Insert new subnode before the specified location in the subnode list. More...
 
bool IsLeaf () const
 Report whether this is a leaf node. More...
 
bool IsParent (const TTreeType &tree_node) const
 Check if node is a direct or indirect parent of this node. More...
 
void FindNodes (const TKeyList &node_path, TNodeList *res)
 Find tree nodes corresponding to the path from the top. More...
 
TTreeTypeFindOrCreateNode (const TKeyList &node_path)
 Find or create tree node corresponding to the path from the top. More...
 
void FindNodes (const TKeyList &node_path, TConstNodeList *res) const
 Find tree nodes corresponding to the path from the top. More...
 
const TTreeTypeFindSubNode (const TKeyType &key) const
 Non recursive linear scan of all subnodes, with key comparison. More...
 
TTreeTypeFindSubNode (const TKeyType &key)
 Non recursive linear scan of all subnodes, with key comparison. More...
 
const TTreeTypeFindNode (const TKeyType &key, TNodeSearchMode sflag=eImmediateAndTop) const
 Search for node. More...
 
unsigned int CountNodes (unsigned int depth=1, TCountNodes how=0) const
 Count nodes of the tree of which this node is a root. More...
 
template<class TNodeComparator >
void SortChildren (const TNodeComparator &compare)
 

Public Attributes

Int4 begin
 
Int4 end
 
struct CTreeNodeleft
 
struct CTreeNoderight
 
LinkedHSPhsplist
 

Protected Member Functions

void CopyFrom (const TTreeType &tree)
 
void SetParent (TTreeType *parent_node)
 
const TNodeListGetSubNodes () const
 

Protected Attributes

TTreeTypem_Parent
 Pointer on the parent node. More...
 
TNodeList m_Nodes
 List of dependent nodes. More...
 
TValue m_Value
 Node value. More...
 

Detailed Description

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
struct CTreeNode< TValue, TKeyGetter >

definition of a Culling tree

Definition at line 88 of file ncbi_tree.hpp.

Member Typedef Documentation

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef list<const TTreeType*> CTreeNode< TValue, TKeyGetter >::TConstNodeList

Definition at line 95 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef int CTreeNode< TValue, TKeyGetter >::TCountNodes

Bitwise mask of ECountNodes.

See also
CountNodes, ECountNodes

Definition at line 339 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef list<TKeyType> CTreeNode< TValue, TKeyGetter >::TKeyList

Definition at line 100 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TKeyGetter::TKeyType CTreeNode< TValue, TKeyGetter >::TKeyType

Definition at line 92 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef list<TTreeType*> CTreeNode< TValue, TKeyGetter >::TNodeList

Definition at line 94 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TNodeList::const_iterator CTreeNode< TValue, TKeyGetter >::TNodeList_CI

Definition at line 97 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TNodeList::const_reverse_iterator CTreeNode< TValue, TKeyGetter >::TNodeList_CRI

Definition at line 99 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TNodeList::iterator CTreeNode< TValue, TKeyGetter >::TNodeList_I

Definition at line 96 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TNodeList::reverse_iterator CTreeNode< TValue, TKeyGetter >::TNodeList_RI

Definition at line 98 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef int CTreeNode< TValue, TKeyGetter >::TNodeSearchMode

Bitwise mask of ENodeSearchType.

Definition at line 321 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef CTreeNode<TValue, TKeyGetter> CTreeNode< TValue, TKeyGetter >::TTreeType

Definition at line 93 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
typedef TValue CTreeNode< TValue, TKeyGetter >::TValueType

Definition at line 91 of file ncbi_tree.hpp.

Member Function Documentation

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TKeyType& CTreeNode< TValue, TKeyGetter >::GetKey ( void  ) const
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TKeyType& CTreeNode< TValue, TKeyGetter >::GetKey ( void  )
inline

Definition at line 175 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TTreeType* CTreeNode< TValue, TKeyGetter >::GetParent ( void  ) const
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TTreeType* CTreeNode< TValue, TKeyGetter >::GetParent ( void  )
inline

Get node's parent.

Returns
parent to the current node, NULL if it is a top of the tree

Definition at line 122 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TTreeType* CTreeNode< TValue, TKeyGetter >::GetRoot ( void  )

Get the topmost node.

Returns
global parent of the current node, this if it is a top of the tree
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TNodeList& CTreeNode< TValue, TKeyGetter >::GetSubNodes ( ) const
inlineprotected

Definition at line 373 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TValue& CTreeNode< TValue, TKeyGetter >::GetValue ( void  ) const
inline

Return node's value.

Definition at line 161 of file ncbi_tree.hpp.

Referenced by CBioTree< TBioNode >::AddFeature(), CTreeQueryExec::CallFunction(), CMacroEngine::CallFunction(), CClusterer::ComputeClusters(), CTree::ComputeTree(), CBlobStorageFactory::CreateInstance(), CPluginManager< TClass >::CreateInstanceFromKey(), CScannerFunctorEQ::Eval(), CScannerFunctorGT::Eval(), CScannerFunctorGE::Eval(), CScannerFunctorLT::Eval(), CScannerFunctorLE::Eval(), CScannerFunctorAND::Eval(), CScannerFunctorOR::Eval(), CScannerFunctorNOT::Eval(), CTableQueryExec::EvalNext(), CTreeQueryExec::EvalNext(), CMQueryFunctionValue::Evaluate(), CMQueryFunctionRTVar::Evaluate(), CMQueryFunctionOps_BooleanBinary::Evaluate(), CBDB_FileScanner::Evaluate(), CMQueryFunctionAssignment::Evaluate(), CMQueryFunctionFunction::Evaluate(), CMQueryFunctionDummy::Evaluate(), CMQueryFunctionOps_Comparison::Evaluate(), CQueryFunction_BV_In_Or< BV >::Evaluate(), CQueryFuncPromoteIdentifier::Evaluate(), CQueryFuncPromoteAndOr::Evaluate(), CQueryFuncPromoteLogic::Evaluate(), CQueryFuncPromoteEq::Evaluate(), CQueryFuncPromoteIn::Evaluate(), CQueryFuncLike::Evaluate(), CQueryFuncPromoteGtLt::Evaluate(), CQueryFuncPromoteBetween::Evaluate(), CQueryFunction_BV_Base< BV >::GetContainer(), CGBDataLoader::GetParam(), CQueryFuncPromoteBase::GetQueryNodeValue(), CCgiApplicationCached::Init(), IsDisabledCache(), CTree::ListTreeEdges(), CTree::ListTreeLeaves(), CQueryFunction_BV_Base< BV >::MakeContainer(), CQueryFuncPromoteBase::MakeQueryNodeValue(), newickparse(), CDistMethods::NjTree(), STreeNodeMapper::operator()(), SNodeNameUpdater::operator()(), CQueryTreeFieldResolveFunc::operator()(), SUidCollector::operator()(), CQueryExecEvalFunc::operator()(), CQueryTreeResetFunc::operator()(), SUidCounter::operator()(), CBioTree< TBioNode >::CFindUidFunc::operator()(), CQueryExecPreProcessFunc::operator()(), CScannerEvaluateFunc::operator()(), CQueryHighlightFunction::operator()(), CQueryTreePrintFunc::operator()(), CQueryFuncPromoteBase::PreProcess(), PrintNode(), CDistMethods::RerootTree(), CQueryFuncPromoteBase::ResolveAndPromote(), s_AddFastMeSubtree(), s_AddNodeToBtc(), s_AddOrReplaceSubNode(), s_ConvertFastMeTree(), s_CreateTreeLeaf(), s_FindLeafDistances(), s_FindNodeDistance(), s_GetNewick(), s_MakeTwoLeafTree(), s_ResetQueryNode(), s_ScaleTreeEdges(), s_SetLeafIds(), s_TestTree(), s_TraverseTree(), CSQLITE3_Cache::SameCacheParams(), CBDB_Cache::SameCacheParams(), CMacroRep::SetAssignmentWhereClause(), SPluginParams::SetDefaultValue(), CMacroRep::SetFunction(), CMacroRep::SetFunctionParameterAsBool(), CMacroRep::SetFunctionParameterAsFloat(), CMacroRep::SetFunctionParameterAsIdent(), CMacroRep::SetFunctionParameterAsInt(), CMacroRep::SetFunctionParameterAsString(), CBioTree< TBioNode >::SetNodeId(), CGBDataLoader::SetParam(), CTaxTreeBrowser::SetSelectedUids(), ThrowCMacroExecException(), CMultiAligner::x_AlignClusterQueries(), CMultiAligner::x_AlignProgressive(), CMultiAligner::x_AttachClusterTrees(), CAlignFilter::x_Complexity(), CPhyTreeCalc::x_CorrectBranchLengths(), CMacroExec::x_EvaluateQueryTree(), CQueryParsePanel::x_ExecuteQuery(), CDistMethods::x_FindLargestEdge(), CAlignFilter::x_FuncCall(), CTaxTreeBrowser::x_GetName(), CConfig::x_GetString(), CMacroExec::x_GetTopUserNodeValue(), CQueryParsePanel::x_IsValidQuery(), CClusterer::x_JoinClustElem(), CClusterer::x_JoinClusters(), CClusterer::x_JoinElements(), CAlignFilter::x_Match(), CMacroParser::x_ParseDo(), CTaxTreeBrowser::x_PopulateTree(), CAlignFilter::x_Query_Op(), CMacroEngine::x_ResolveRTVar(), CAlignFilter::x_TermValue(), and CDistMethods::ZeroNegativeBranches().

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TValue& CTreeNode< TValue, TKeyGetter >::GetValue ( void  )
inline

Return node's value.

Definition at line 164 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
bool CTreeNode< TValue, TKeyGetter >::IsLeaf ( ) const
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TValue& CTreeNode< TValue, TKeyGetter >::operator* ( void  ) const
inline

Definition at line 169 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TValue& CTreeNode< TValue, TKeyGetter >::operator* ( void  )
inline

Definition at line 170 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
const TValue* CTreeNode< TValue, TKeyGetter >::operator-> ( void  ) const
inline

Definition at line 171 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TValue* CTreeNode< TValue, TKeyGetter >::operator-> ( void  )
inline

Definition at line 172 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
void CTreeNode< TValue, TKeyGetter >::SetParent ( TTreeType parent_node)
inlineprotected
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
void CTreeNode< TValue, TKeyGetter >::SetValue ( const TValue &  value)
inline

Set value for the node.

Definition at line 167 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
template<class TNodeComparator >
void CTreeNode< TValue, TKeyGetter >::SortChildren ( const TNodeComparator &  compare)
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_CI CTreeNode< TValue, TKeyGetter >::SubNodeBegin ( void  ) const
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_I CTreeNode< TValue, TKeyGetter >::SubNodeBegin ( void  )
inline

Return first iterator on subnode list.

Definition at line 140 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_CI CTreeNode< TValue, TKeyGetter >::SubNodeEnd ( void  ) const
inline
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_I CTreeNode< TValue, TKeyGetter >::SubNodeEnd ( void  )
inline

Return last iterator on subnode list.

Definition at line 146 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_CRI CTreeNode< TValue, TKeyGetter >::SubNodeRBegin ( void  ) const
inline

Return first const reverse iterator on subnode list.

Definition at line 149 of file ncbi_tree.hpp.

Referenced by CMenuItem::x_InsertInUnnamedGroup().

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_RI CTreeNode< TValue, TKeyGetter >::SubNodeRBegin ( void  )
inline

Return first reverse iterator on subnode list.

Definition at line 152 of file ncbi_tree.hpp.

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_CRI CTreeNode< TValue, TKeyGetter >::SubNodeREnd ( void  ) const
inline

Return last const reverse iterator on subnode list.

Definition at line 155 of file ncbi_tree.hpp.

Referenced by CMenuItem::x_InsertInUnnamedGroup().

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList_RI CTreeNode< TValue, TKeyGetter >::SubNodeREnd ( void  )
inline

Return last reverse iterator on subnode list.

Definition at line 158 of file ncbi_tree.hpp.

Member Data Documentation

template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
Int4 CTreeNode< TValue, TKeyGetter >::begin
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
Int4 CTreeNode< TValue, TKeyGetter >::end
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
LinkedHSP* CTreeNode< TValue, TKeyGetter >::hsplist
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
struct CTreeNode* CTreeNode< TValue, TKeyGetter >::left
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TNodeList CTreeNode< TValue, TKeyGetter >::m_Nodes
protected
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TTreeType* CTreeNode< TValue, TKeyGetter >::m_Parent
protected
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
TValue CTreeNode< TValue, TKeyGetter >::m_Value
protected
template<class TValue, class TKeyGetter = CDefaultNodeKeyGetter<TValue>>
struct CTreeNode* CTreeNode< TValue, TKeyGetter >::right

The documentation for this struct was generated from the following files:
Modified on Wed Aug 16 06:02:33 2017 by modify_doxy.py rev. 533848