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 TBoolIsEmpty()
IMPORT_C voidReset()
IMPORT_C voidSetOffset(TInt)
Protected Member Functions
TSglQueBase()
TSglQueBase(TInt)
IMPORT_C voidDoAddFirst(TAny *)
IMPORT_C voidDoAddLast(TAny *)
IMPORT_C voidDoRemove(TAny *)
Private Member Functions
TSglQueBase(const TSglQueBase &)
TSglQueBase &operator=(const TSglQueBase &)
Protected Attributes
TSglQueLink *iHead
TSglQueLink *iLast
TInt iOffset

Constructor & Destructor Documentation

TSglQueBase()

IMPORT_CTSglQueBase()[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_CTSglQueBase(TIntaOffset)[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 aOffsetThe 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 voidDoAddFirst(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 * aPtrAn untyped pointer to the element to be inserted.

DoAddLast(TAny *)

IMPORT_C voidDoAddLast(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 * aPtrAn untyped pointer to the element to be inserted.

DoRemove(TAny *)

IMPORT_C voidDoRemove(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 * aPtrAn untyped pointer to the element to be removed.

IsEmpty()

IMPORT_C TBoolIsEmpty()const

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

Reset()

IMPORT_C voidReset()

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 voidSetOffset(TIntaOffset)

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