NCBI C++ ToolKit
|
Search Toolkit Book for CTreeNode
definition of a Culling tree More...
#include <corelib/ncbi_tree.hpp>
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 TKeyGetterP | TKeyGetter |
typedef TKeyGetter::TKeyType | TKeyType |
typedef TKeyGetter::TKeyEqual | TKeyEqual |
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< TKeyType > | TKeyList |
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 (const TKeyGetter &getter, const TValue &value=TValue()) | |
virtual | ~CTreeNode () |
CTreeNode (const TTreeType &tree) | |
CTreeNode & | operator= (const TTreeType &tree) |
const TKeyGetter & | GetKeyGetter (void) const |
Get key getter. More... | |
const TTreeType * | GetParent (void) const |
Get node's parent. More... | |
TTreeType * | GetParent (void) |
Get node's parent. More... | |
const TTreeType * | GetRoot (void) const |
Get the topmost node. More... | |
TTreeType * | GetRoot (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 TKeyType & | GetKey (void) const |
TKeyType & | GetKey (void) |
const TKeyEqual & | GetKeyEqual () const |
Return key equal predicate. More... | |
bool | KeyEqual (const TKeyType &key) const |
Check if the node's key is equal to the argument. More... | |
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... | |
TTreeType * | DetachNode (TTreeType *subnode) |
Remove the subtree from the tree without destroying it. More... | |
TTreeType * | DetachNode (TNodeList_I it) |
Remove the subtree from the tree without destroying it. More... | |
void | AddNode (TTreeType *subnode) |
Add new subnode. More... | |
TTreeType * | AddNode (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... | |
TTreeType * | FindOrCreateNode (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 TTreeType * | FindSubNode (const TKeyType &key) const |
Non recursive linear scan of all subnodes, with key comparison. More... | |
TTreeType * | FindSubNode (const TKeyType &key) |
Non recursive linear scan of all subnodes, with key comparison. More... | |
const TTreeType * | FindNode (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 CTreeNode * | left |
struct CTreeNode * | right |
LinkedHSP * | hsplist |
Protected Member Functions | |
void | CopyFrom (const TTreeType &tree) |
void | SetParent (TTreeType *parent_node) |
const TNodeList & | GetSubNodes () const |
Protected Attributes | |
pair_base_member< TKeyGetter, TTreeType * > | m_GetterAndParent |
Key getter and pointer to the parent node. More... | |
TNodeList | m_Nodes |
List of dependent nodes. More... | |
TValue | m_Value |
Node value. More... | |
definition of a Culling tree
Definition at line 99 of file ncbi_tree.hpp.
Int4 CTreeNode< TValue, TKeyGetterP >::begin |
Definition at line 202 of file hspfilter_culling.c.
Referenced by s_CTreeNodeNew(), and s_ForkChildren().
Int4 CTreeNode< TValue, TKeyGetterP >::end |
Definition at line 203 of file hspfilter_culling.c.
Referenced by s_CTreeNodeNew(), and s_ForkChildren().
LinkedHSP* CTreeNode< TValue, TKeyGetterP >::hsplist |
Definition at line 206 of file hspfilter_culling.c.
Referenced by s_CTreeNodeFree(), s_CTreeNodeNew(), s_ForkChildren(), and s_SaveHSP().
struct CTreeNode* CTreeNode< TValue, TKeyGetterP >::left |
Definition at line 204 of file hspfilter_culling.c.
Referenced by s_CTreeNodeFree(), s_CTreeNodeNew(), s_ForkChildren(), and s_SaveHSP().
struct CTreeNode* CTreeNode< TValue, TKeyGetterP >::right |
Definition at line 205 of file hspfilter_culling.c.
Referenced by s_CTreeNodeFree(), s_CTreeNodeNew(), s_ForkChildren(), and s_SaveHSP().