TSglQueBase Class Reference

#include <e32std.h>

class TSglQueBase
Protected Attributes
TSglQueLink *iHead
TSglQueLink *iLast
TInt iOffset
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 *)

Detailed Description

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.

See also: TSglQue

Member Attribute Documentation

iHead

TSglQueLink *iHead[protected]

A pointer to the first element in the list.

iLast

TSglQueLink *iLast[protected]

A pointer to the last element in the list.

iOffset

TInt iOffset[protected]

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

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.

See also: 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

See also: iHead iLast iOffset

ParameterDescription
aOffsetThe offset of a link object within an element.

Member Function 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().

See also: TSglQue::AddFirst

ParameterDescription
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().

See also: TSglQue::AddLast

ParameterDescription
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().

See also: TSglQue::Remove

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

Returns: True, if the singly linked list is empty; false, otherwise.

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.

See also: TSglQue

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