Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32std.h

Class TPriQue

class TPriQue : public TDblQueBase;

Description

A templated class that provides the behaviour for managing a doubly linked list in which the elements are added in descending priority order.

Priority is defined by the value of the TPriQueLink::iPriority member of the link element.

The template parameter defines the type of element that forms the doubly linked list and is the class that acts as host to the link object.

Derivation

Members

Defined in TPriQue:
Add(), First(), IsFirst(), IsHead(), IsLast(), Last(), TPriQue(), TPriQue()

Inherited from TDblQueBase:
DoAddFirst(), DoAddLast(), DoAddPriority(), IsEmpty(), Reset(), SetOffset(), __DbgTestEmpty(), iHead, iOffset

See also:


Construction and destruction


TPriQue()

inline TPriQue();

Description

Default constructor.

Constructs an empty list header and sets the offset value of the link object to zero.

In practice, never assume that the offset of the link object from the start of a list element is zero, even if the link object is declared as the first data member in the list element class.

If this default constructor is used, then call the SetOffset() function of the base class to ensure that the offset value is set correctly.


TPriQue()

inline TPriQue(TInt aOffset);

Description

Constructs an empty list header and sets the offset of the link object to the specified value.

Parameters

TInt aOffset

The offset of the link object from the start of a list element. The macro _FOFF can be used to calculate this value.

Panic codes

USER

78 if aOffset is not divisible by four.

[Top]


Member functions


Add()

inline void Add(T &aRef);

Description

Inserts the specified list element in descending priority order.

If there is an existing list element with the same priority, then the new element is added after the existing element.

Parameters

T &aRef

The list element to be inserted.


IsHead()

inline TBool IsHead(const T *aPtr) const;

Description

Tests whether the end of a list has been reached.

A doubly linked list is circular; in following the chain of elements in a list (e.g. using the iterator operator++ or operator--), the chain eventually reaches the end of the list and aPtr corresponds to the header (although it will not point to a valid T object).

Parameters

const T *aPtr

The pointer value to be checked.

Return value

TBool

True, if the end of the list has been reached. False, if the end of the list has not been reached; aPtr points to an element in the list.


IsFirst()

inline TBool IsFirst(const T *aPtr) const;

Description

Tests whether the specified element is the first in the linked list.

Parameters

const T *aPtr

A pointer to the element whose position in the list is to be checked.

Return value

TBool

True, if the element is the first in the list; false, otherwise.


IsLast()

inline TBool IsLast(const T *aPtr) const;

Description

Tests whether the specified element is the last in the linked list.

Parameters

const T *aPtr

A pointer to the element whose position in the list is to be checked.

Return value

TBool

True, if the element is the last in the list; false, otherwise.


First()

inline T *First() const;

Description

Gets a pointer to the first list element in the linked list.

Return value

T *

A pointer to the first list element in the linked list. If the list is empty, this pointer is not necessarily NULL and must not be assumed to point to a valid object.


Last()

inline T *Last() const;

Description

Gets a pointer to the last list element in the linked list.

Return value

T *

A pointer to the last list element in the linked list. If the list is empty, this pointer is not necessarily NULL and must not be assumed to point to a valid object.