Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



How to construct an iterator

To create an iterator for a singly linked list of CMyClass elements, defined as:

class CMyClass : public CBase
    {
    ...
    TSglQueLink iSlink;
    ...
    };

first construct a header:

TSglQue<CMyClass> queHeader(_FOFF(CMyClass,islink));

and then construct the iterator. The iterator requires the header at construction time but the list can be empty:

TsGlQueIter<CMyClass> queIter(queHeader);

The TSglQueIter class takes a class template parameter that defines the type of object which is to form an element of the list.