RHexTreeBase Class Reference

class RHexTreeBase

Base class that provides the implementation for RHexTree, which is just a thin template.

An instance of this class can have up to eight 16-way prefix trees, with heights from 1 to 8. All the values are stored in the leaves. To find a value from a 32-bit key, first the key is decomposed into 8 hexadecimal digits and then the prefix tree with height matching the number of digits in the key (ignoring zeros to the left) is traversed using the sequence of digits in the key as the indexing string. Offsets are internally used instead of pointers to allow instances to be placed in a heap shared between several processes.

Public Member Functions
IMPORT_C voidResetAndDestroy()
Protected Member Functions
RHexTreeBase(RHeap *)
IMPORT_C TAny *At(TUint)
IMPORT_C TIntSetAt(TUint, TAny *)
Private Member Functions
TAny *At(TUint, TInt)
voidResetAndDestroy(TInt, TAny *, TInt)
TInt SetAt(TUint, TAny *, TInt)
TInt SetAt(TUint, TAny *, TInt, TAny *, TInt)
Private Attributes
RHeap *iHeap
TInt iRootOffsets

Constructor & Destructor Documentation

RHexTreeBase(RHeap *)

IMPORT_CRHexTreeBase(RHeap *aHeap)[protected]

Parameters

RHeap * aHeap

Member Functions Documentation

At(TUint)

IMPORT_C TAny *At(TUintaKey)const [protected]

Parameters

TUint aKey

At(TUint, TInt)

TAny *At(TUintaKey,
TIntaHeight
)const [private]

Parameters

TUint aKey
TInt aHeight

ResetAndDestroy()

IMPORT_C voidResetAndDestroy()

Empties this associative array and frees all memory allocated both for the associative array implementation and for the values that have been added to this associative array.

The internal state of this associative array is reset so that it can be reused or allowed to go out of scope after a call to this function.

ResetAndDestroy(TInt, TAny *, TInt)

voidResetAndDestroy(TIntaHeight,
TAny *aNode,
TIntaLevel
)[private]

Parameters

TInt aHeight
TAny * aNode
TInt aLevel

SetAt(TUint, TAny *)

IMPORT_C TIntSetAt(TUintaKey,
TAny *aValue
)[protected]

Parameters

TUint aKey
TAny * aValue

SetAt(TUint, TAny *, TInt)

TInt SetAt(TUintaKey,
TAny *aLeaf,
TIntaHeight
)[private]

Parameters

TUint aKey
TAny * aLeaf
TInt aHeight

SetAt(TUint, TAny *, TInt, TAny *, TInt)

TInt SetAt(TUintaKey,
TAny *aLeaf,
TIntaHeight,
TAny *aNode,
TIntaLevel
)[private]

Parameters

TUint aKey
TAny * aLeaf
TInt aHeight
TAny * aNode
TInt aLevel

Member Data Documentation

RHeap * iHeap

RHeap *iHeap[private]

TInt iRootOffsets

TInt iRootOffsets[private]