User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Trees - BinaryTreeBodyC<class KeyT,class DataT>
 

  PUBLIC
BinaryTreeBodyC::BinaryTreeBodyC(void)
BinaryTreeBodyC::~BinaryTreeBodyC(void)
BinaryTreeBodyC::Copy(void) const
BinaryTreeBodyC::Empty(void)
BinaryTreeBodyC::Size(void) const
BinaryTreeBodyC::IsEmpty(void) const
BinaryTreeBodyC::Find(const KeyT &,DataT &)
BinaryTreeBodyC::MinData(void)
BinaryTreeBodyC::MaxData(void)
BinaryTreeBodyC::MinKey(void) const
BinaryTreeBodyC::MaxKey(void) const
BinaryTreeBodyC::Remove(const KeyT &)
BinaryTreeBodyC::Insert(const KeyT &,const DataT &,bool)
BinaryTreeBodyC::Dump(ostream &)
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   BinaryTreeBodyC<class KeyT,class DataT>   
 
Binary tree body.
 
include "Ravl/BinaryTree.hh"
User Level:Develop
Library:RavlCore
Example:exBinaryTree.cc
In Scope:RavlN

Comments:
This class implements a simple binary tree. NB. No attempt to balance the tree is made so only use this class if you are sure data will be inserted in a random order.

Parent Classes: Derived Classes: Variables:
Methods:
BinaryTreeBodyC()
Constructor

~BinaryTreeBodyC()
Destructor.

RCBodyC & Copy() const
Make copy of tree.

void Empty()
Empty the tree of all contents.

SizeT Size() const
Number of elements in tree.

bool IsEmpty() const
Is tree empty ?

bool Find(const KeyT & key,DataT & result)
Find a data item with 'key' in the tree.
return true if found, false otherwise.

DataT & MinData()
Get the data with smallest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

DataT & MaxData()
Get the data at the largest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

const KeyT & MinKey() const
Get the smallest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

const KeyT & MaxKey() const
Get the largest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

bool Remove(const KeyT & key)
Remove an item from tree.

bool Insert(const KeyT & key,const DataT & dat,bool overwrite = true)
Insert a node into the tree.
If 'overwrite' is true, and a node with the given key is already in the tree then it will be overwritten otherwise 'false' will be returned.

void Dump(ostream & out)
Dump the stream in a human readable fomat.
Usefull for debuging.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002