MBtreeKey Class Reference

#include <s32btree.h>

Link against: estor.lib

class MBtreeKey
Public Member Functions
pure virtual voidBetween(const TAny *, const TAny *, TBtreePivot &)
pure virtual TInt Compare(const TAny *, const TAny *)
virtual IMPORT_C const TAny *Key(const TAny *)

Detailed Description

Interface for ordering and creating keys for entries in a B-tree.

Derived classes implement this interface for particular types of key.

Member Function Documentation

Between ( const TAny *, const TAny *, TBtreePivot & )

voidBetween(const TAny *aLeft,
const TAny *aRight,
TBtreePivot &aPivot
)const [pure virtual]

Gets the midpoint between two keys.

The generated midpoint will be greater or equal to aLeft (by a comparison performed by the Compare() function), and less than aRight.

ParameterDescription
aLeftFirst key
aRightSecond key
aPivotOn return, the midpoint between the two keys

Compare ( const TAny *, const TAny * )

TInt Compare(const TAny *aLeft,
const TAny *aRight
)const [pure virtual]

Orders two keys.

ParameterDescription
aLeftPointer to first key
aRightPointer to second key

Returns: Positive, if the first key is after the second key; negative, if the first key is before the second key; zero, if the keys are equal

Key ( const TAny * )

IMPORT_C const TAny *Key(const TAny *anEntry)const [virtual]

Gets the key value for an entry.

ParameterDescription
anEntryObject for which to get the key value

Returns: Pointer to the key value