C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Balanced tree. More...

#include <templ_balance_tree.h>

Public Member Functions

 BalanceTree (Compare_t c_t=SimplePointCompFuncT, Compare_v c_v=nullptr, bool shouldDelete=true)
 Constructor.
 
virtual ~BalanceTree ()
 Destructor.
 
bool Add (Type *)
 Add element.
 
size_t Count () const
 Set count of elements.
 
void Flush (DelType=defDelete)
 Delete all elements.
 
bool Remove (Type *delObject, DelType=defDelete)
 Delete an element from array.
 
bool FindIt (const Type *) const
 Find an element by a pointer.
 
Type * Find (void *) const
 Find an element.
 
bool Detach (const Type *)
 Detach an object.
 

Public Attributes

BalanceTreeNode< Type > * root_m
 Root of tree.
 
size_t allCount_m
 Count.
 
bool owns_m
 Whether it is possible to delete elements.
 
bool isBranchGrew_m
 Flag of growth of a tree.
 
Compare_t compT_m
 Sorting function is used while adding an object.
 
Compare_v compV_m
 Sorting function is used while search an object.
 

Protected Member Functions

bool AddToBalanceTree (Type &content, BalanceTreeNode< Type > *&node, bool &isBranchGrew)
 Add object to tree.
 
bool DeleteFromBalanceTree (Type &content, BalanceTreeNode< Type > *&node, bool &isBranchGrew, DelType del)
 Delete an object from tree.
 
void BalanceL (BalanceTreeNode< Type > *&node, bool &isBranchGrew)
 Balance left branch.
 
void BalanceR (BalanceTreeNode< Type > *&node, bool &isBranchGrew)
 Balance right branch.
 

Detailed Description

template<class Type>
class BalanceTree< Type >

Balanced tree.

Balanced tree.


The documentation for this class was generated from the following file: