AVL_tree_namespace::AVLTree< avlkey_t > Class Template Reference

#include <avltree.h>

Inheritance diagram for AVL_tree_namespace::AVLTree< avlkey_t >:

GEN::PacketGenerator::StreamPool

List of all members.

Public Member Functions

 AVLTree ()
virtual ~AVLTree ()
int32u GetCount (void) const
void AddNode (pnode_t pNode)
BOOL RemoveNode (pnode_t pNode)
pnode_t RemoveHead ()
pnode_t RemoveTail ()

Public Attributes

pnode_t pRoot
int32u Count

Private Types

typedef AVLNode< avlkey_t > * pnode_t


Detailed Description

template<class avlkey_t>
class AVL_tree_namespace::AVLTree< avlkey_t >

Definition at line 281 of file avltree.h.


Member Typedef Documentation

template<class avlkey_t >
typedef AVLNode< avlkey_t >* AVL_tree_namespace::AVLTree< avlkey_t >::pnode_t [private]

Definition at line 283 of file avltree.h.


Constructor & Destructor Documentation

template<class avlkey_t >
AVL_tree_namespace::AVLTree< avlkey_t >::AVLTree (  )  [inline]

Definition at line 294 of file avltree.h.

00295     {
00296         pRoot = NULL;
00297         Count = 0;
00298     }

template<class avlkey_t >
virtual AVL_tree_namespace::AVLTree< avlkey_t >::~AVLTree (  )  [inline, virtual]

Definition at line 300 of file avltree.h.

00300 {}


Member Function Documentation

template<class avlkey_t >
void AVL_tree_namespace::AVLTree< avlkey_t >::AddNode ( pnode_t  pNode  )  [inline]

Definition at line 306 of file avltree.h.

00307     {
00308                 if( pNode )
00309                 {
00310                         pRoot = ( pRoot )? pRoot->InsertNode( pNode ): pNode->Initialize();
00311                         Count++;
00312                 }
00313     }

template<class avlkey_t >
int32u AVL_tree_namespace::AVLTree< avlkey_t >::GetCount ( void   )  const [inline]

Definition at line 303 of file avltree.h.

00303 { return Count; }

template<class avlkey_t >
pnode_t AVL_tree_namespace::AVLTree< avlkey_t >::RemoveHead ( void   )  [inline]

Definition at line 323 of file avltree.h.

00324     {
00325         pnode_t pNode = NULL;
00326         if( pRoot ) pRoot = pRoot->RemoveLeftEnd( &pNode );
00327         if( pNode ) Count--;
00328         return pNode;
00329     }

template<class avlkey_t >
BOOL AVL_tree_namespace::AVLTree< avlkey_t >::RemoveNode ( pnode_t  pNode  )  [inline]

Definition at line 315 of file avltree.h.

00316     {
00317         BOOL result = FALSE;
00318         if( pRoot && pNode ) pRoot = pRoot->RemoveNode( pNode, &result );
00319         if( result ) Count--;
00320         return result;
00321     }

template<class avlkey_t >
pnode_t AVL_tree_namespace::AVLTree< avlkey_t >::RemoveTail ( void   )  [inline]

Definition at line 331 of file avltree.h.

00332     {
00333         //NODE_t* pNode = NULL;
00334         pnode_t pNode = NULL;
00335 
00336         if( pRoot ) pRoot = pRoot->RemoveRightEnd( &pNode );
00337         if( pNode ) Count--;
00338         return pNode;
00339     }


Member Data Documentation

template<class avlkey_t >
int32u AVL_tree_namespace::AVLTree< avlkey_t >::Count

Definition at line 289 of file avltree.h.

template<class avlkey_t >
pnode_t AVL_tree_namespace::AVLTree< avlkey_t >::pRoot

Definition at line 288 of file avltree.h.


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

Generated on Thu Nov 28 14:47:25 2013 for red_wireless by  doxygen 1.5.7.1