RHashTableBase Class Reference

class RHashTableBase

Base class used in the derivation of RHashSet<T>, RPtrHashSet<T>, RHashMap<K,V> and RPtrHashMap<K,V>.

This class provides a general hash table implementation using probe sequences generated by pseudo-double hashing. The class is internal and is not intended for use.

Protected Member Functions
RHashTableBase ( TGeneralHashFunction32 , TGeneralIdentityRelation , TInt , TInt )
IMPORT_C void Close ()
IMPORT_C void ConsistencyCheck ( TUint32 *, TUint32 *, TUint32 , TUint32 *)
IMPORT_C TInt Count ()
IMPORT_C TAny * Find (const TAny *, TInt )
IMPORT_C TAny * FindL (const TAny *, TInt )
TInt Insert (const TAny *, TAny *&)
IMPORT_C TInt PtrInsert (const TAny *, const TAny *)
IMPORT_C void PtrInsertL (const TAny *, const TAny *)
IMPORT_C TInt Remove (const TAny *)
IMPORT_C TInt Reserve ( TInt )
IMPORT_C void ReserveL ( TInt )
IMPORT_C TInt ValueInsert (const TAny *, TInt , const TAny *, TInt , TInt )
IMPORT_C void ValueInsertL (const TAny *, TInt , const TAny *, TInt , TInt )
Private Member Functions
SElement * Element ( TInt )
const SElement * ElementC ( TInt )
TInt ExpandTable ( TInt )
TAny * GetKey (const SElement *)
void ReformTable ( TUint )
void SetThresholds ()
void ShrinkTable ()
void VerifyReform ()
Public Member Enumerations
enum TDefaultSpecifier { EDefaultSpecifier_Normal }
Protected Member Enumerations
enum TElementState {
EEmpty  = 0, EDeleted  = 1, EGen0  = 2, EGen1  = 3, EStateMask  = 3, EOccupiedMask  = 2
}
Private Attributes
TUint32 iCleanThreshold
TUint32 iCount
TInt iElementSize
TAny * iElements
TUint32 iEmptyCount
TUint8 iGeneration
TGeneralHashFunction32 iHashFunc
TGeneralIdentityRelation iIdFunc
TUint8 iIndexBits
TUint8 iKeyOffset
TUint32 iLowerThreshold
TUint8 iPad0
TInt iPad1
TInt iPad2
TUint32 iUpperThreshold

Constructor & Destructor Documentation

RHashTableBase(TGeneralHashFunction32, TGeneralIdentityRelation, TInt, TInt)

IMPORT_C RHashTableBase ( TGeneralHashFunction32 ,
TGeneralIdentityRelation ,
TInt aElementSize,
TInt aKeyOffset
) [protected]

Member Functions Documentation

Close()

IMPORT_C void Close ( ) [protected]

ConsistencyCheck(TUint32 *, TUint32 *, TUint32, TUint32 *)

IMPORT_C void ConsistencyCheck ( TUint32 * aDeleted = 0,
TUint32 * aComparisons = 0,
TUint32 aChainLimit = 0,
TUint32 * aChainInfo = 0
) [protected]

Parameters

TUint32 * aDeleted = 0
TUint32 * aComparisons = 0
TUint32 aChainLimit = 0
TUint32 * aChainInfo = 0

Count()

IMPORT_C TInt Count ( ) const [protected]

Element(TInt)

SElement * Element ( TInt aIndex ) [private, inline]

Parameters

TInt aIndex

ElementC(TInt)

const SElement * ElementC ( TInt aIndex ) const [private, inline]

Parameters

TInt aIndex

ExpandTable(TInt)

TInt ExpandTable ( TInt aNewIndexBits ) [private]

Parameters

TInt aNewIndexBits

Find(const TAny *, TInt)

IMPORT_C TAny * Find ( const TAny * aKey,
TInt aOffset = 0
) const [protected]

Parameters

const TAny * aKey
TInt aOffset = 0

FindL(const TAny *, TInt)

IMPORT_C TAny * FindL ( const TAny * aKey,
TInt aOffset = 0
) const [protected]

Parameters

const TAny * aKey
TInt aOffset = 0

GetKey(const SElement *)

TAny * GetKey ( const SElement * aElement ) const [private, inline]

Parameters

const SElement * aElement

Insert(const TAny *, TAny *&)

TInt Insert ( const TAny * aKey,
TAny *& aElement
) [protected]

Parameters

const TAny * aKey
TAny *& aElement

PtrInsert(const TAny *, const TAny *)

IMPORT_C TInt PtrInsert ( const TAny * aKey,
const TAny * aValue
) [protected]

Parameters

const TAny * aKey
const TAny * aValue

PtrInsertL(const TAny *, const TAny *)

IMPORT_C void PtrInsertL ( const TAny * aKey,
const TAny * aValue
) [protected]

Parameters

const TAny * aKey
const TAny * aValue

ReformTable(TUint)

void ReformTable ( TUint aNewIndexBits ) [private]

Parameters

TUint aNewIndexBits

Remove(const TAny *)

IMPORT_C TInt Remove ( const TAny * aKey ) [protected]

Parameters

const TAny * aKey

Reserve(TInt)

IMPORT_C TInt Reserve ( TInt aCount ) [protected]

Parameters

TInt aCount

ReserveL(TInt)

IMPORT_C void ReserveL ( TInt aCount ) [protected]

Parameters

TInt aCount

SetThresholds()

void SetThresholds ( ) [private]

ShrinkTable()

void ShrinkTable ( ) [private]

ValueInsert(const TAny *, TInt, const TAny *, TInt, TInt)

IMPORT_C TInt ValueInsert ( const TAny * aKey,
TInt aKeySize,
const TAny * aValue,
TInt aValueOffset,
TInt aValueSize
) [protected]

Parameters

const TAny * aKey
TInt aKeySize
const TAny * aValue
TInt aValueOffset
TInt aValueSize

ValueInsertL(const TAny *, TInt, const TAny *, TInt, TInt)

IMPORT_C void ValueInsertL ( const TAny * aKey,
TInt aKeySize,
const TAny * aValue,
TInt aValueOffset,
TInt aValueSize
) [protected]

Parameters

const TAny * aKey
TInt aKeySize
const TAny * aValue
TInt aValueOffset
TInt aValueSize

VerifyReform()

void VerifyReform ( ) [private]

Member Enumerations Documentation

Enum TDefaultSpecifier

Enumerators

EDefaultSpecifier_Normal

Enum TElementState

Enumerators

EEmpty = 0
EDeleted = 1
EGen0 = 2
EGen1 = 3
EStateMask = 3
EOccupiedMask = 2

Member Data Documentation

TUint32 iCleanThreshold

TUint32 iCleanThreshold [private]

TUint32 iCount

TUint32 iCount [private]

TInt iElementSize

TInt iElementSize [private]

TAny * iElements

TAny * iElements [private]

TUint32 iEmptyCount

TUint32 iEmptyCount [private]

TUint8 iGeneration

TUint8 iGeneration [private]

TGeneralHashFunction32 iHashFunc

TGeneralHashFunction32 iHashFunc [private]

TGeneralIdentityRelation iIdFunc

TGeneralIdentityRelation iIdFunc [private]

TUint8 iIndexBits

TUint8 iIndexBits [private]

TUint8 iKeyOffset

TUint8 iKeyOffset [private]

TUint32 iLowerThreshold

TUint32 iLowerThreshold [private]

TUint8 iPad0

TUint8 iPad0 [private]

TInt iPad1

TInt iPad1 [private]

TInt iPad2

TInt iPad2 [private]

TUint32 iUpperThreshold

TUint32 iUpperThreshold [private]