Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes

KMap< KEY_TYPE, VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > Class Template Reference

Search for all occurrences

Detailed Description

template<typename KEY_TYPE, typename VALUE_TYPE, typename KEY_COMPARE_FUNCTOR = KFbxLessCompare<KEY_TYPE>, typename ALLOCATOR = KBaseAllocator>
class KMap< KEY_TYPE, VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR >

Examples:

ViewScene/Texture.h.

Definition at line 1483 of file kmap.h.

#include <kmap.h>

List of all members.

Classes

class   KKeyValuePair

Public Types

typedef VALUE_TYPE  ValueType
typedef KEY_TYPE  KeyType
typedef StorageType::RecordType  RecordType
typedef StorageType::IteratorType  Iterator
typedef
StorageType::ConstIteratorType 
ConstIterator

Public Member Functions

  KMap ()
  KMap (KMap const &pMap)
  ~KMap ()
void  Reserve (unsigned int pRecordCount)
int  GetSize () const
KPair< RecordType *, bool >  Insert (KeyType const &pKey, ValueType const &pValue)
int  Remove (KeyType const &pKey)
void  Clear ()
bool  Empty () const
Iterator  Begin ()
Iterator  End ()
ConstIterator  Begin () const
ConstIterator  End () const
RecordType const *  Find (KeyType const &pKey) const
RecordType Find (KeyType const &pKey)
RecordType const *  UpperBound (KeyType const &pKey) const
RecordType UpperBound (KeyType const &pKey)
ValueType operator[] (KeyType const &pKey)
RecordType const *  Minimum () const
RecordType Minimum ()
RecordType const *  Maximum () const
RecordType Maximum ()

Protected Types

typedef KRedBlackTree
< KKeyValuePair,
KEY_COMPARE_FUNCTOR, ALLOCATOR > 
StorageType

Protected Attributes

StorageType  mTree

Member Typedef Documentation

typedef KRedBlackTree<KKeyValuePair, KEY_COMPARE_FUNCTOR, ALLOCATOR> StorageType [protected]

Definition at line 1505 of file kmap.h.

typedef VALUE_TYPE ValueType

Definition at line 1510 of file kmap.h.

typedef KEY_TYPE KeyType

Definition at line 1511 of file kmap.h.

typedef StorageType::RecordType RecordType

Definition at line 1512 of file kmap.h.

Definition at line 1513 of file kmap.h.

Definition at line 1514 of file kmap.h.


Constructor & Destructor Documentation

KMap ( ) [inline]

Definition at line 1516 of file kmap.h.

{}
KMap ( KMap< KEY_TYPE, VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > const &  pMap ) [inline]

Definition at line 1517 of file kmap.h.

: mTree(pMap.mTree) {}
~KMap ( ) [inline]

Definition at line 1518 of file kmap.h.

{Clear();}

Member Function Documentation

void Reserve ( unsigned int  pRecordCount ) [inline]

Definition at line 1520 of file kmap.h.

    {
        mTree.Reserve(pRecordCount);
    }
int GetSize ( ) const [inline]

Definition at line 1525 of file kmap.h.

    {
        return mTree.GetSize();
    }
KPair<RecordType*, bool> Insert ( KeyType const &  pKey,
ValueType const &  pValue 
) [inline]

Definition at line 1530 of file kmap.h.

    {
        return mTree.Insert(KKeyValuePair(pKey, pValue));
    }
int Remove ( KeyType const &  pKey ) [inline]

Definition at line 1535 of file kmap.h.

    {
        return mTree.Remove(pKey);
    }
void Clear ( ) [inline]

Definition at line 1540 of file kmap.h.

    {
        mTree.Clear();
    }
bool Empty ( ) const [inline]

Definition at line 1545 of file kmap.h.

    {
        return mTree.Empty();
    }
Iterator Begin ( ) [inline]

Definition at line 1550 of file kmap.h.

    {
        return Iterator(Minimum());
    }
Iterator End ( ) [inline]

Definition at line 1555 of file kmap.h.

    {
        return Iterator();
    }
ConstIterator Begin ( ) const [inline]

Definition at line 1560 of file kmap.h.

    {
        return ConstIterator(Minimum());
    }
ConstIterator End ( ) const [inline]

Definition at line 1565 of file kmap.h.

    {
        return ConstIterator();
    }
RecordType const* Find ( KeyType const &  pKey ) const [inline]

Definition at line 1570 of file kmap.h.

    {
        return mTree.Find(pKey);
    }
RecordType* Find ( KeyType const &  pKey ) [inline]

Definition at line 1575 of file kmap.h.

    {
        return mTree.Find(pKey);
    }
RecordType const* UpperBound ( KeyType const &  pKey ) const [inline]

Definition at line 1580 of file kmap.h.

    {
        return mTree.UpperBound(pKey);
    }
RecordType* UpperBound ( KeyType const &  pKey ) [inline]

Definition at line 1585 of file kmap.h.

    {
        return mTree.UpperBound(pKey);
    }
ValueType& operator[] ( KeyType const &  pKey ) [inline]

Definition at line 1590 of file kmap.h.

    {
        RecordType* lRecord = Find(pKey);

        if( !lRecord )
        {
            lRecord = Insert(pKey, ValueType()).mFirst;
        }

        return lRecord->GetValue();
    }
RecordType const* Minimum ( ) const [inline]

Definition at line 1602 of file kmap.h.

    {
        return mTree.Minimum();
    }
RecordType* Minimum ( ) [inline]

Definition at line 1607 of file kmap.h.

    {
        return mTree.Minimum();
    }
RecordType const* Maximum ( ) const [inline]

Definition at line 1612 of file kmap.h.

    {
        return mTree.Maximum();
    }
RecordType* Maximum ( ) [inline]

Definition at line 1617 of file kmap.h.

    {
        return mTree.Maximum();
    }

Member Data Documentation

StorageType mTree [protected]

Definition at line 1506 of file kmap.h.


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