Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TKeyArrayPak Class Reference

Defines the characteristics of a key used to access the elements of packed arrays. More...

#include <e32base.h>

Inheritance diagram for TKeyArrayPak:
TKeyArrayVar TKey

Public Member Functions

IMPORT_C TKeyArrayPak (TInt anOffset, TKeyCmpText aType)
 Constructs the characteristics of a descriptor key.
 
IMPORT_C TKeyArrayPak (TInt anOffset, TKeyCmpText aType, TInt aLength)
 Constructs the characteristics of a text key.
 
IMPORT_C TKeyArrayPak (TInt anOffset, TKeyCmpNumeric aType)
 Constructs the characteristics of a numeric key.
 
- Public Member Functions inherited from TKeyArrayVar
IMPORT_C TKeyArrayVar (TInt anOffset, TKeyCmpText aType)
 Constructs the characteristics of a descriptor key.
 
IMPORT_C TKeyArrayVar (TInt anOffset, TKeyCmpText aType, TInt aLength)
 Constructs the characteristics of a text key.
 
IMPORT_C TKeyArrayVar (TInt anOffset, TKeyCmpNumeric aType)
 Constructs the characteristics of a numeric key.
 
- Public Member Functions inherited from TKey
void SetPtr (const TAny *aPtr)
 Sets the pointer to a sample element whose key is to be used for comparison.
 
virtual IMPORT_C TInt Compare (TInt aLeft, TInt aRight) const
 Compares the keys of two array elements.
 

Protected Member Functions

virtual IMPORT_C void Set (CBufBase *aBase)
 
IMPORT_C TAny * At (TInt anIndex) const
 Gets a pointer to the key of a specified array element.
 
- Protected Member Functions inherited from TKeyArrayVar
IMPORT_C TAny * At (TInt anIndex) const
 Gets a pointer to the key of a specified array element.
 
- Protected Member Functions inherited from TKey
IMPORT_C TKey ()
 Protected default constructor.
 
IMPORT_C TKey (TInt aOffset, TKeyCmpText aType)
 Constructs the characteristics of a descriptor type key.
 
IMPORT_C TKey (TInt aOffset, TKeyCmpText aType, TInt aLength)
 Constructs the characteristics of a text key.
 
IMPORT_C TKey (TInt aOffset, TKeyCmpNumeric aType)
 Constructs the characteristics of a numeric key.
 

Friends

class CArrayPakBase
 

Additional Inherited Members

- Protected Attributes inherited from TKeyArrayVar
CBufBase * iBase
 
- Protected Attributes inherited from TKey
TInt iKeyOffset
 
TInt iKeyLength
 
TInt iCmpType
 
const TAny * iPtr
 

Detailed Description

Defines the characteristics of a key used to access the elements of packed arrays.

An object of this type can represent three categories of key, depending on the constructor used:

  1. a descriptor key
  2. a text key
  3. a numeric key.

The InsertIsqL(), Find() and FindIsqL() member functions of the CArrayPakFlat class hierarchy need a TKeyArrayPak object as an argument to define the location and type of key within an array element.

Note that a TKeyArrayVar object is required for sorting a packed array. The implementation of the SortL() member function of the CArrayPakFlat class constructs a temporary CArrayVarFlat object which requires the TKeyArrayVar object.

See also
CArrayVarSeg
CArrayPakFlat
TKeyArrayVar
API status
Published to all clients. Released API.

Definition at line 925 of file e32base.h.

Constructor & Destructor Documentation

◆ TKeyArrayPak() [1/3]

IMPORT_C TKeyArrayPak::TKeyArrayPak ( TInt  anOffset,
TKeyCmpText  aType 
)

Constructs the characteristics of a descriptor key.

No length value is passed as this is taken from the descriptor type key.

TKeyCmpText

Parameters
anOffsetThe offset of the key from the start of an array element.
aTypeAn enumeration which defines the type of comparison to be made between two descriptor keys.

(generated from Symbian Developer Library)

◆ TKeyArrayPak() [2/3]

IMPORT_C TKeyArrayPak::TKeyArrayPak ( TInt  anOffset,
TKeyCmpText  aType,
TInt  aLength 
)

Constructs the characteristics of a text key.

TKeyCmpText

Parameters
anOffsetThe offset of the key from the start of an array element.
aTypeAn enumeration which defines the type of comparison to be made between two text keys.
aLengthThe length of the text key.

(generated from Symbian Developer Library)

◆ TKeyArrayPak() [3/3]

IMPORT_C TKeyArrayPak::TKeyArrayPak ( TInt  anOffset,
TKeyCmpNumeric  aType 
)

Constructs the characteristics of a numeric key.

TKeyCmpNumeric

Parameters
anOffsetThe offset of the key from the start of an array element.
aTypeAn enumeration which defines the type of the numeric key.

(generated from Symbian Developer Library)

Member Function Documentation

◆ At()

IMPORT_C TAny * TKeyArrayPak::At ( TInt  anIndex) const
protectedvirtual

Gets a pointer to the key of a specified array element.

The default implementation raises a USER 35 panic.

The function is called by TKey::Compare() to compare the keys of two elements.

The implementation provided by a derived class must convert the index to a pointer to the key within the corresponding element. The implementation depends on the design of the array but, as general rule, use the index value to get a pointer to the corresponding element and then add the TKey protected data member iKeyOffset to this pointer to get a pointer to the key itself.

By convention, the index value is relative to zero; i.e. a zero value refers to the first element in the array. By this convention, the index can take any value between zero and the number of elements within the array minus one.

The function must also handle the special index value KIndexPtr. When this value is passed, the function should return a pointer to the key within the sample element. A pointer to the sample element is held in the protected data member iPtr and can be set up using SetPtr().

The implementation of this function also assumes that the derived class has a pointer to the array itself or has a function for finding it.

Parameters
anIndexThe index of the array element or the special index value KIndexPtr.

Panic condition: USER 35, if no replacement function has been provided by a derived class.

(generated from Symbian Developer Library)

Reimplemented from TKey.

◆ Set()

virtual IMPORT_C void TKeyArrayPak::Set ( CBufBase *  aBase)
protectedvirtual

Reimplemented from TKeyArrayVar.

Friends And Related Symbol Documentation

◆ CArrayPakBase

friend class CArrayPakBase
friend

Definition at line 967 of file e32base.h.


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