KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType Class Reference


Detailed Description

template<typename DATA_TYPE, typename KEY_COMPARE_FUNCTOR, typename ALLOCATOR>
class KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType

This class represents a node in the tree.

It contains the key, the value, and internal tree management data.

Definition at line 273 of file kmap.h.

#include <kmap.h>

List of all members.

Public Member Functions

ConstKeyType GetKey () const
ConstValueType GetValue () const
ValueType GetValue ()
RecordType const *  Minimum () const
RecordType Minimum ()
RecordType const *  Maximum () const
RecordType Maximum ()
RecordType const *  Predecessor () const
RecordType Predecessor ()
RecordType const *  Successor () const
RecordType Successor ()
int  GetBlackDepth () const

Friends

class  KRedBlackTree

Member Function Documentation

ConstKeyType& GetKey ( ) const [inline]

Definition at line 276 of file kmap.h.

{ return mData.GetKey(); }
ConstValueType& GetValue ( ) const [inline]

Definition at line 277 of file kmap.h.

{ return mData.GetValue(); }
ValueType& GetValue ( ) [inline]

Definition at line 278 of file kmap.h.

{ return mData.GetValue(); }
RecordType const* Minimum ( ) const [inline]

Definition at line 280 of file kmap.h.

        {
            RecordType const* lParent = 0;
            RecordType const* lNode = this;
            while (lNode != 0)
            {
                lParent = lNode;
                lNode = lNode->mLeftChild;
            }

            return lParent;
        }
RecordType* Minimum ( ) [inline]

Definition at line 293 of file kmap.h.

        {
            RecordType* lParent = 0;
            RecordType* lNode = this;
            while (lNode != 0)
            {
                lParent = lNode;
                lNode = lNode->mLeftChild;
            }

            return lParent;
        }
RecordType const* Maximum ( ) const [inline]

Definition at line 306 of file kmap.h.

        {
            RecordType const* lParent = 0;
            RecordType const* lNode = this;
            while (lNode != 0)
            {
                lParent = lNode;
                lNode = lNode->mRightChild;
            }

            return lParent;
        }
RecordType* Maximum ( ) [inline]

Definition at line 319 of file kmap.h.

        {
            RecordType* lParent = 0;
            RecordType* lNode = this;
            while (lNode != 0)
            {
                lParent = lNode;
                lNode = lNode->mRightChild;
            }

            return lParent;
        }
RecordType const* Predecessor ( ) const [inline]

Definition at line 332 of file kmap.h.

        {
            if (mLeftChild)
            {
                return mLeftChild->Maximum();
            }
            else
            {
                RecordType const* lParent = mParent;
                RecordType const* lNode = this;

                while (lParent && lParent->mLefttChild == lNode)
                {
                    lNode = lParent;
                    lParent = lParent->mParent;
                }

                return lParent;
            }
        }
RecordType* Predecessor ( ) [inline]

Definition at line 353 of file kmap.h.

        {
            if (mLeftChild)
            {
                return mLeftChild->Maximum();
            }
            else
            {
                RecordType* lParent = mParent;
                RecordType* lNode = this;

                while (lParent && lParent->mLeftChild == lNode)
                {
                    lNode = lParent;
                    lParent = lParent->mParent;
                }

                return lParent;
            }
        }
RecordType const* Successor ( ) const [inline]

Definition at line 374 of file kmap.h.

        {
            if (mRightChild)
            {
                return mRightChild->Minimum();
            }
            else
            {
                RecordType const* lParent = mParent;
                RecordType const* lNode = this;

                while (lParent && lParent->mRightChild == lNode)
                {
                    lNode = lParent;
                    lParent = lParent->mParent;
                }

                return lParent;
            }
        }
RecordType* Successor ( ) [inline]

Definition at line 395 of file kmap.h.

        {
            if (mRightChild)
            {
                return mRightChild->Minimum();
            }
            else
            {
                RecordType* lParent = mParent;
                RecordType* lNode = this;

                while (lParent && lParent->mRightChild == lNode)
                {
                    lNode = lParent;
                    lParent = lParent->mParent;
                }

                return lParent;
            }
        }
int GetBlackDepth ( ) const [inline]

Definition at line 416 of file kmap.h.

{ return mBlackDepth; }

Friends And Related Function Documentation

friend class KRedBlackTree [friend]

Definition at line 443 of file kmap.h.


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

KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType
KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType KRedBlackTree< DATA_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >::RecordType