BALANCEDTREE< _ITEMTYPE > Class Template Reference

Simple balanced tree container. More...

#include <mi32/balancedtree.h>

List of all members.

Classes

class  DUMP
 Interface class to "dump" an item from the tree, used in TraverseTree(). More...
class  TEST
 Interface class to test two tree items, can use default if _T::operator<() defined. More...

Public Member Functions

 BALANCEDTREE ()
 ~BALANCEDTREE ()
ERRVALUE Allocate (INT32 InitialNumItems, TEST Test=TEST())
ERRVALUE Clear ()
INT32 FindAndInsertKey (_ITEMTYPE &Item, INT32 CurTagNum, bool &AddedItem)
bool IsAllocated () const
INT32 LocateKey (const _ITEMTYPE &Item)
ERRVALUE TraverseTree (DUMP &Dump)

Detailed Description

template<typename _ITEMTYPE>
class BALANCEDTREE< _ITEMTYPE >

Simple balanced tree container.


Constructor & Destructor Documentation

template<typename _ITEMTYPE >
BALANCEDTREE< _ITEMTYPE >::BALANCEDTREE (  )  [inline]

Constructor.

template<typename _ITEMTYPE >
BALANCEDTREE< _ITEMTYPE >::~BALANCEDTREE (  )  [inline]

Destructor.


Member Function Documentation

template<typename _ITEMTYPE >
ERRVALUE BALANCEDTREE< _ITEMTYPE >::Allocate ( INT32  InitialNumItems,
TEST  Test = TEST() 
) [inline]

Initialize the balanced tree giving an initial number of items.

template<typename _ITEMTYPE >
ERRVALUE BALANCEDTREE< _ITEMTYPE >::Clear (  )  [inline]

Clear the balanced tree of all items.

template<typename _ITEMTYPE >
INT32 BALANCEDTREE< _ITEMTYPE >::FindAndInsertKey ( _ITEMTYPE &  Item,
INT32  CurTagNum,
bool &  AddedItem 
) [inline]

Locate an item in the tree and return its key value.

If the item does not exist, add it to the tree

Parameters:
CurTagNum Tag number to use if 'Item' is added to the tree
AddedItem Set to 'true' if 'Item' is added to the tree
template<typename _ITEMTYPE >
bool BALANCEDTREE< _ITEMTYPE >::IsAllocated (  )  const [inline]

Determine if the balanced tree Allocate() method has been called.

template<typename _ITEMTYPE >
INT32 BALANCEDTREE< _ITEMTYPE >::LocateKey ( const _ITEMTYPE &  Item  )  [inline]

Locate an item in the tree and return its key value.

Returns:
-1 = Not found, < -1 Error, else the tag number associated with the data.
template<typename _ITEMTYPE >
ERRVALUE BALANCEDTREE< _ITEMTYPE >::TraverseTree ( DUMP Dump  )  [inline]

Traverse the balanced tree in sorted order.


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

Generated on Sun Oct 7 21:33:13 2012 for TNTsdk 2012 by  doxygen 1.6.1