Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: e32std.h
Link against: euser.lib

Class TDblQueIter

TDblQueIter<class T>

Support

Supported from 5.0

Description

A templated class that provides the behaviour for iterating through a set of doubly linked list elements.

The template parameter defines the type of element that forms the doubly linked list. The class defined in the template parameter contains the link object.

Derivation

TDblQueIterA templated class that provides the behaviour for iterating through a set of doubly linked list elements
TDblQueIterBaseA base class that provides implementation for the doubly linked list iterator

Defined in TDblQueIter:
Set(), TDblQueIter(), operator T*(), operator++(), operator--()

Inherited from TDblQueIterBase:
SetToFirst(), SetToLast()

See also:


Construction


TDblQueIter()

TDblQueIter(TDblQueBase& aQue);

Description

Constructs the iterator for the specified doubly linked list

The iterator can be constructed whether or not the list contains any elements.

If the list has no elements, the iterator pointer is not set and the conversion operator T*(), the post increment operator ++ and the post decrement operator -- subsequently return NULL. Once elements have been added to the list, use either the TDblQueIter<class T>::Set() function, the TDblQueIterBase::SetToFirst() function or the TDblQueIterBase::SetToLast() function to set the iterator pointer.

Parameters

TDblQueBase& aQue

A reference to a doubly linked list header.

[Top]


Set iterator


Set()

void Set(T& aLink);

Description

Sets the iterator to point to a specific element in the list.

This function can be used to alter the pointer at any time during the iterator’s existence. The referenced element must be in the list, otherwise the result is undefined.

Parameters

T& aLink

A reference to the element from where iteration is to continue.

[Top]


Accessing elements


operator T*()

operator T*();

Description

Returns a pointer to the iterator’s current element.

The operator is normally used implicitly; e.g. some member functions of the list header class TDblQue<class T> require a pointer to an element (of type class T) as a parameter but in practice, an iterator is often passed instead. This operator performs the necessary conversion.

Return value

operator

A pointer to the current element, if the iterator points to an element in the list. NULL, if the iterator does not point to an element; i.e. the iterator pointer has previously reached the end of the list (see operator++) or the start of the list (see operator--) or the list is empty.


operator++()

T* operator++(TInt);

Description

Returns a pointer to the iterator’s current element and then sets the iterator to point to the next element. Repeated use of this operator allows successive elements to be accessed in the forwards direction.

Parameters

TInt

The element to be incremented.

Return value

T*

A pointer to the current list element, if the iterator points to an element. NULL, if the iterator does not point to an element; i.e. the iterator pointer has reached the end of the list.


operator--()

T* operator--(TInt);

Description

Returns a pointer to the iterator’s current element and then sets the iterator to point to the previous element. Repeated use of this operator allows successive elements to be accessed in the backwards direction.

Parameters

TInt

The element being decremented.

Return value

T*

A pointer to the current element, if the iterator points to an element. NULL, if the iterator does not point to an element; i.e. the iterator pointer has reached the beginning of the list.