Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to construct a header

In order to construct a header, two important pieces of information are needed:

To create a header for a doubly linked list of CMyClass elements, defined as:

class CMyClass : public CBase
    {
    ...
    TDblQueLink iDlink;
    ...
    };

construct a TDblQue as follows:

TDblQue<CMyClass> queHeader(_FOFF(CMyClass,iDlink));

The TDblQue class takes a class template parameter which defines the type of object which is to form an element of the list. In this example, objects of type CMyClass form the elements of the list.

The _FOFF macro (i.e. the "field offset" macro) calculates the offset of the component link object within the element. In this example, the required value is the offset of the iDlink data member from the start of CMyClass.