TSglQueBase Class Reference

class TSglQueBase

A base class that provides implementation for the singly linked list header.

It also encapsulates the offset value of a link object.

The class is abstract and is not intended to be instantiated.

TSglQue

Public Member Functions
IMPORT_C TBool IsEmpty ()
IMPORT_C void Reset ()
IMPORT_C void SetOffset ( TInt )
Protected Member Functions
TSglQueBase ()
TSglQueBase ( TInt )
IMPORT_C void DoAddFirst ( TAny *)
IMPORT_C void DoAddLast ( TAny *)
IMPORT_C void DoRemove ( TAny *)
Private Member Functions
TSglQueBase (const TSglQueBase &)
TSglQueBase & operator= (const TSglQueBase &)
Protected Attributes
TSglQueLink * iHead
TSglQueLink * iLast
TInt iOffset

Constructor & Destructor Documentation

TSglQueBase()

IMPORT_C TSglQueBase ( ) [protected]

Default constructor.

It sets:

1. iHead to Null.

2. iLast to point to the head of queue.

3. iOffset to zero.

iHead iLast iOffset

TSglQueBase(TInt)

IMPORT_C TSglQueBase ( TInt aOffset ) [protected]

Constructor with specified offset.

It sets:

1. iHead to Null

2. iLast to point to the head of queue.

3. iOffset to the specified value.

panic
USER 75, if aOffset is not divisible by four
iHead iLast iOffset

Parameters

TInt aOffset The offset of a link object within an element.

TSglQueBase(const TSglQueBase &)

TSglQueBase ( const TSglQueBase & aQue ) [private]

Parameters

const TSglQueBase & aQue

Member Functions Documentation

DoAddFirst(TAny *)

IMPORT_C void DoAddFirst ( TAny * aPtr ) [protected]

Implements the insertion of a list element at the front of the singly linked list.

This function is called by TSglQue::AddFirst() .

TSglQue::AddFirst

Parameters

TAny * aPtr An untyped pointer to the element to be inserted.

DoAddLast(TAny *)

IMPORT_C void DoAddLast ( TAny * aPtr ) [protected]

Implements the insertion of a list element at the back of the singly linked list.

This function is called by TSglQue::AddLast() .

TSglQue::AddLast

Parameters

TAny * aPtr An untyped pointer to the element to be inserted.

DoRemove(TAny *)

IMPORT_C void DoRemove ( TAny * aPtr ) [protected]

Implements the removal of a list element from the singly linked list.

This function is called by TSglQue::Remove() .

TSglQue::Remove

Parameters

TAny * aPtr An untyped pointer to the element to be removed.

IsEmpty()

IMPORT_C TBool IsEmpty ( ) const

Tests whether the singly linked list is empty, i.e. has no list elements.

Reset()

IMPORT_C void Reset ( )

Empties the singly linked list.

After a call to this function, there are no elements queued from the header; the elements are orphaned. Special care must be taken when list elements are CBase derived objects, i.e. are allocated on the heap.

SetOffset(TInt)

IMPORT_C void SetOffset ( TInt aOffset )

Sets the offset of the link object from the start of a singly linked list element.

panic
USER 75, if aOffset is not divisible by four.
TSglQue

Parameters

TInt aOffset The offset of the link object from the start of a singly linked list element.

operator=(const TSglQueBase &)

TSglQueBase & operator= ( const TSglQueBase & aQue ) [private]

Parameters

const TSglQueBase & aQue

Member Data Documentation

TSglQueLink * iHead

TSglQueLink * iHead [protected]

A pointer to the first element in the list.

TSglQueLink * iLast

TSglQueLink * iLast [protected]

A pointer to the last element in the list.

TInt iOffset

TInt iOffset [protected]

The offset of a component link object within elements that form the list.