claw::binary_node< U > Class Template Reference

Basic binary node. More...

#include <binary_node.hpp>

List of all members.

Public Member Functions

 binary_node ()
 Binary node constructor.
 binary_node (const binary_node &that)
 Binary node copy constructor.
 ~binary_node ()
 Binary node destructor. Deletes the whole subtree.
void clear ()
 Clear right and left childs. Memory's not freed.

Public Attributes

U * left
 Left child.
U * right
 Right child.

Detailed Description

template<class U>
class claw::binary_node< U >

Basic binary node.

Author:
Julien Jorge

Definition at line 41 of file binary_node.hpp.


Constructor & Destructor Documentation

template<class U >
claw::binary_node< U >::binary_node (  )  [inline, explicit]

Binary node constructor.

Postcondition:
(left==NULL) && (right==NULL)

Definition at line 38 of file binary_node.tpp.

00039   : left(NULL), right(NULL)
00040 {
00041 
00042 } //binary_node()

template<class U >
claw::binary_node< U >::binary_node ( const binary_node< U > &  that  )  [inline, explicit]

Binary node copy constructor.

Parameters:
that Node to copy from.

Definition at line 50 of file binary_node.tpp.

References claw::binary_node< U >::left, and claw::binary_node< U >::right.

00051 {
00052   if (that.left)
00053     left = new U( * that.left );
00054   else
00055     left = NULL;
00056 
00057   if ( that.right )
00058     right = new U( * that.right );
00059   else
00060     right = NULL;
00061 } // binary_node() [copy constructor]

template<class U >
claw::binary_node< U >::~binary_node (  )  [inline]

Binary node destructor. Deletes the whole subtree.

Definition at line 81 of file binary_node.tpp.

References claw::binary_node< U >::left, and claw::binary_node< U >::right.

00082 {
00083   if (left)
00084     delete left;
00085 
00086   if (right)
00087     delete right;
00088 } // ~binary_node() [destructor]


Member Function Documentation

template<class U >
void claw::binary_node< U >::clear (  )  [inline]

Clear right and left childs. Memory's not freed.

Postcondition:
this->left == NULL && this->right == NULL

Definition at line 69 of file binary_node.tpp.

References claw::binary_node< U >::left, and claw::binary_node< U >::right.

Referenced by claw::avl_base< K, Comp >::recursive_delete_max(), and claw::avl_base< K, Comp >::recursive_delete_node().

00070 {
00071   left = NULL;
00072   right = NULL;
00073 } // clear()


Member Data Documentation

template<class U>
U* claw::binary_node< U >::left
template<class U>
U* claw::binary_node< U >::right

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

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1