diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-59ED6D14-0976-58AE-8DDC-73F051866406.dita --- a/Symbian3/SDK/Source/GUID-59ED6D14-0976-58AE-8DDC-73F051866406.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-59ED6D14-0976-58AE-8DDC-73F051866406.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,46 +1,46 @@ - - - - - -How -to construct a headerThe header of a linked list needs to know the type of data for -each list element, and where in each element the pointer to the next element -can be found. -

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

- -

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

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

construct a TSglQue as follows:

-TSglQue<CMyClass> queHeader(_FOFF(CMyClass,iSlink)); -

The TSglQue 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 iSlink data member -from the start of CMyClass.

- -Links in singly linked lists - - + + + + + +How +to construct a headerThe header of a linked list needs to know the type of data for +each list element, and where in each element the pointer to the next element +can be found. +

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

+
    +
  • the type of object +which forms the elements.

  • +
  • the offset of +the link object from the start of the element.

  • +
+

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

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

construct a TSglQue as follows:

+TSglQue<CMyClass> queHeader(_FOFF(CMyClass,iSlink)); +

The TSglQue 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 iSlink data member +from the start of CMyClass.

+ +Links in singly linked lists + +
\ No newline at end of file