Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: agmlists.h
Link against: agnmodel.lib

Class CAgnList

CAgnList<class InstanceItem>

Support

Supported from 5.0

Description

Interface to a list of agenda items. The type of item is specified by the user of the class.

Derivation

CAgnListInterface to a list of agenda items
CBaseBase class for all classes to be instantiated on the heap

Defined in CAgnList:
AppendL(), CAgnList(), Count(), Delete(), Find(), InsertL(), Reset(), operator[]()

Inherited from CBase:
operator new()


Construction


CAgnList()

CAgnList();

Description

The default C++ constructor is used to construct the list object.

[Top]


Update list contents


AppendL()

void AppendL(const InstanceItem& aElement);

Description

Appends a list item to the end of the existing list.

Parameters

const InstanceItem& aElement

The list item to be appended.


Delete()

void Delete(TInt aIndex);

Description

Removes a list item from the list.

Parameters

TInt aIndex

The index of the item to be deleted. A panic occurs if the index is out of range.


InsertL()

void InsertL(TInt aIndex,const InstanceItem& aElement);

Description

Inserts a list item into the list.

Parameters

TInt aIndex

The position in the list at which the item should be inserted — relative to zero.

const InstanceItem& aElement

The item to be inserted.


Reset()

void Reset();

Description

Removes all list items from the list.

[Top]


List information


Count()

TInt Count() const;

Description

Returns the current number of list instances.

Return value

TInt

The current number of list instances.

[Top]


Get list item


Find()

TInt Find(const InstanceItem& aItem,TKeyArrayFix& aKey,TInt& aPos) const;

Description

Finds the index of the first item which matches the item specified in aKey. The search is sequential, starting with the first object in the array.

Parameters

const InstanceItem& aItem

Reference to the object which is used for comparison.

TKeyArrayFix& aKey

Reference to a key object defining the properties of the key to use in the search.

TInt& aPos

If the element is found, the reference is set to the position of that element within the array. The position is relative to zero, (i.e. the first element in the array is at position 0). If the element is not found and the array is not empty, then the value of the reference is set to the number of elements in the array. If the element is not found and the array is empty, then the reference is set to zero.

Return value

TInt

Zero, if the element with the specified key is found, otherwise non-zero.


operator[]()

const InstanceItem& operator[](TInt aIndex) const;

Description

Gets an item from the list.

Parameters

TInt aIndex

The index of the required item in the list.

Return value

InstanceItem&

A reference to the item at position aIndex.