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

KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > Class Template Reference

Search for all occurrences

Detailed Description

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

Definition at line 1634 of file kmap.h.

#include <kmap.h>

List of all members.

Classes

class   KValue

Public Types

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

Public Member Functions

  KSet2 ()
  KSet2 (KSet2 const &pSet)
  ~KSet2 ()
void  Reserve (unsigned int pRecordCount)
int  GetSize () const
KPair< RecordType *, bool >  Insert (ValueType const &pValue)
int  Remove (ValueType const &pValue)
void  Clear ()
bool  Empty () const
Iterator  Begin ()
Iterator  End ()
ConstIterator  Begin () const
ConstIterator  End () const
RecordType const *  Find (ValueType const &pValue) const
RecordType Find (ValueType const &pValue)
RecordType const *  Minimum () const
RecordType Minimum ()
RecordType const *  Maximum () const
RecordType Maximum ()
bool  operator== (const KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > &pOther) const
bool  operator!= (const KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > &pOther) const
KSet2  Union (const KSet2 &pOther) const

Protected Types

typedef KRedBlackTree< KValue,
KEY_COMPARE_FUNCTOR, ALLOCATOR > 
StorageType

Protected Attributes

StorageType  mTree

Member Typedef Documentation

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

Definition at line 1659 of file kmap.h.

typedef VALUE_TYPE ValueType

Definition at line 1664 of file kmap.h.

typedef StorageType::RecordType RecordType

Definition at line 1665 of file kmap.h.

Definition at line 1666 of file kmap.h.

Definition at line 1667 of file kmap.h.


Constructor & Destructor Documentation

KSet2 ( ) [inline]

Definition at line 1669 of file kmap.h.

{}
KSet2 ( KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > const &  pSet ) [inline]

Definition at line 1670 of file kmap.h.

: mTree(pSet.mTree) {}
~KSet2 ( ) [inline]

Definition at line 1671 of file kmap.h.

{Clear();}

Member Function Documentation

void Reserve ( unsigned int  pRecordCount ) [inline]

Definition at line 1673 of file kmap.h.

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

Definition at line 1678 of file kmap.h.

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

Definition at line 1683 of file kmap.h.

    {
        return mTree.Insert(KValue(pValue));
    }
int Remove ( ValueType const &  pValue ) [inline]

Definition at line 1688 of file kmap.h.

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

Definition at line 1693 of file kmap.h.

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

Definition at line 1698 of file kmap.h.

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

Definition at line 1703 of file kmap.h.

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

Definition at line 1708 of file kmap.h.

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

Definition at line 1713 of file kmap.h.

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

Definition at line 1718 of file kmap.h.

    {
        return ConstIterator();
    }
RecordType const* Find ( ValueType const &  pValue ) const [inline]

Definition at line 1723 of file kmap.h.

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

Definition at line 1728 of file kmap.h.

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

Definition at line 1733 of file kmap.h.

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

Definition at line 1738 of file kmap.h.

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

Definition at line 1743 of file kmap.h.

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

Definition at line 1748 of file kmap.h.

    {
        return mTree.Maximum();
    }
bool operator== ( const KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > &  pOther ) const [inline]

Definition at line 1753 of file kmap.h.

    {
        return (this == &pOther) || (mTree == pOther.mTree);
    }
bool operator!= ( const KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > &  pOther ) const [inline]

Definition at line 1758 of file kmap.h.

    {
        return !(*this == pOther);
    }
KSet2 Union ( const KSet2< VALUE_TYPE, KEY_COMPARE_FUNCTOR, ALLOCATOR > &  pOther ) const [inline]

Definition at line 1763 of file kmap.h.

    {
        KSet2 lReturn;
        ConstIterator lBegin = Begin();
        for (; lBegin != End(); ++lBegin)
        {
            if (pOther.Find(lBegin->GetValue()) != NULL)
                lReturn.Insert(lBegin->GetValue());
        }
        return lReturn;
    }

Member Data Documentation

StorageType mTree [protected]

Definition at line 1660 of file kmap.h.


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