Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: usbcque.h

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class TSglQueIter

class TSglQueIter : public TSglQueIterBase;

Description

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

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

Derivation

Members

Defined in TSglQueIter:
Set(), TSglQueIter(), TSglQueIter(), operator T *(), operator T *(), operator++(), operator++()

Inherited from TSglQueIterBase:
DoCurrent(), DoPostInc(), DoSet(), SetToFirst(), iHead, iNext, iOffset


Construction and destruction


TSglQueIter()

inline TSglQueIter(TSglQueBase &aQue);

Description

Constructs the iterator for the specified singly linked list.

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

If the list does contain elements, the iterator pointer is set to the first one.

If the list has no elements, the iterator pointer is not set and the conversion operator T*() and the post increment operator ++ subsequently return NULL. Once elements have been added to the list, use either the TSglQueIter::Set() function or the TSglQueIterBase::SetToFirst() function to set the iterator pointer.

Parameters

TSglQueBase &aQue

A reference to a singly linked list header.


TSglQueIter()

inline TSglQueIter(TSglQueBase &aQue);

Description

Parameters

TSglQueBase &aQue

[Top]


Member functions


operator T *()

inline operator T *();

Description

Gets a pointer to the iterator’s current element.

The operator is normally used implicitly; e.g. some member functions of the list header class TSglQue 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++()

inline T *operator++(TInt);

Description

Gets 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.

Parameters

TInt

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.


Set()

inline 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.


operator T *()

inline operator T *();

Description

Return value


operator++()

inline T *operator++(TInt);

Description

Parameters

TInt

Return value

T *