Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CArrayVarFlat< T > Class Template Reference

Array of variable length objects implemented using a flat dynamic buffer. More...

#include <e32base.h>

Inheritance diagram for CArrayVarFlat< T >:
CArrayVar< T > CArrayVarBase CBase

Public Member Functions

 CArrayVarFlat (TInt aGranularity)
 Constructs a variable flat array with specified granularity.
 
- Public Member Functions inherited from CArrayVar< T >
 CArrayVar (TBufRep aRep, TInt aGranularity)
 
const T & operator[] (TInt anIndex) const
 Gets a reference to the const element located at the specified position within the array.
 
T & operator[] (TInt anIndex)
 Gets a reference to the element located at the specified position within the array.
 
const T & At (TInt anIndex) const
 Gets a reference to the const element located at the specified position within the array.
 
T & At (TInt anIndex)
 Gets a reference to the element located at the specified position within the array.
 
void AppendL (const T &aRef, TInt aLength)
 Appends an element of a specified length onto the array.
 
T & ExpandL (TInt anIndex, TInt aLength)
 Expands the array by one element of specified length at the specified position.
 
T & ExtendL (TInt aLength)
 Expands the array by one element of specified length at the end of the array.
 
TInt Find (const T &aRef, TKeyArrayVar &aKey, TInt &anIndex) const
 Finds the position of an element within the array, based on the matching of keys, using a sequential search.
 
TInt FindIsq (const T &aRef, TKeyArrayVar &aKey, TInt &anIndex) const
 Finds the position of an element within the array, based on the matching of keys, using a binary search technique.
 
void InsertL (TInt anIndex, const T &aRef, TInt aLength)
 Inserts an element of a specified length into the array at the specified position.
 
TInt InsertIsqL (const T &aRef, TInt aLength, TKeyArrayVar &aKey)
 Inserts a single element of a specified length into the array at a position determined by a key.
 
TInt InsertIsqAllowDuplicatesL (const T &aRef, TInt aLength, TKeyArrayVar &aKey)
 Inserts a single element of a specified length into the array at a position determined by a key, allowing duplicates.
 
const TArray< T > Array () const
 Constructs and returns a TArray<T> object.
 
- Public Member Functions inherited from CArrayVarBase
IMPORT_C ~CArrayVarBase ()
 Destructor.
 
TInt Count () const
 Gets the number of elements held in the array.
 
IMPORT_C TInt Length (TInt anIndex) const
 Gets the length of a specific element.
 
IMPORT_C void Compress ()
 Removes excess space from the array buffer.
 
IMPORT_C void Reset ()
 Deletes all elements from the array and frees the memory allocated to the array buffer.
 
IMPORT_C TInt Sort (TKeyArrayVar &aKey)
 Sorts the elements of the array into key sequence.
 
IMPORT_C TAny * At (TInt anIndex) const
 Return a pointer to the data in the array.
 
IMPORT_C void Delete (TInt anIndex)
 Removes one element from the array.
 
IMPORT_C void Delete (TInt anIndex, TInt aCount)
 Removes one or more contiguous elements from the array, starting at the specified position.
 
IMPORT_C TAny * ExpandL (TInt anIndex, TInt aLength)
 Expand the array at anIndex.
 
IMPORT_C TInt Find (const TAny *aPtr, TKeyArrayVar &aKey, TInt &anIndex) const
 Find using a sequential search.
 
IMPORT_C TInt FindIsq (const TAny *aPtr, TKeyArrayVar &aKey, TInt &anIndex) const
 Find using a binary search.
 
IMPORT_C void InsertL (TInt anIndex, const TAny *aPtr, TInt aLength)
 Insert a new record in the array.
 
IMPORT_C TInt InsertIsqL (const TAny *aPtr, TInt aLength, TKeyArrayVar &aKey)
 Insert in sequence, no duplicates allowed.
 
IMPORT_C TInt InsertIsqAllowDuplicatesL (const TAny *aPtr, TInt aLength, TKeyArrayVar &aKey)
 Insert in sequence, allow duplicates.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Protected Member Functions inherited from CArrayVarBase
IMPORT_C CArrayVarBase (TBufRep aRep, TInt aGranularity)
 Constructor.
 
IMPORT_C void SetKey (TKeyArrayVar &aKey) const
 Set the key data.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 
- Static Protected Member Functions inherited from CArrayVarBase
static IMPORT_C TInt CountR (const CBase *aPtr)
 Return the number of items in the array.
 
static IMPORT_C const TAny * AtR (const CBase *aPtr, TInt anIndex)
 Return the address of an item in the array.
 

Detailed Description

template<class T>
class CArrayVarFlat< T >

Array of variable length objects implemented using a flat dynamic buffer.

The elements of the array are instances of the template class T and are contained within their own heap cells. Pointers to the elements are maintained within the flat dynamic buffer, a CBufFlat.

The elements can be T or R type objects and must have an accessible default constructor.

See also
CBufFlat
API status
Published to all clients. Released API.

Definition at line 872 of file e32base.h.

Constructor & Destructor Documentation

◆ CArrayVarFlat()

template<class T >
CArrayVarFlat< T >::CArrayVarFlat ( TInt  aGranularity)
inlineexplicit

Constructs a variable flat array with specified granularity.

Note that no memory is allocated to the array buffer by this constructor.

Parameters
aGranularityThe granularity of the array.

Panic condition: E32USER-CBase 19, if aGranularity is not positive.

(generated from Symbian Developer Library)


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