Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TPriQue< T > Class Template Reference

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

#include <e32std.h>

Inheritance diagram for TPriQue< T >:
TDblQueBase

Public Member Functions

 TPriQue ()
 Default constructor.
 
 TPriQue (TInt aOffset)
 Constructs an empty list header and sets the offset of the link object to the specified value.
 
void Add (T &aRef)
 Inserts the specified list element in descending priority order.
 
TBool IsHead (const T *aPtr) const
 Tests whether the end of a list has been reached.
 
TBool IsFirst (const T *aPtr) const
 Tests whether the specified element is the first in the linked list.
 
TBool IsLast (const T *aPtr) const
 Tests whether the specified element is the last in the linked list.
 
T * First () const
 Gets a pointer to the first list element in the linked list.
 
T * Last () const
 Gets a pointer to the last list element in the linked list.
 
- Public Member Functions inherited from TDblQueBase
IMPORT_C TBool IsEmpty () const
 Tests whether the doubly linked list is empty, i.e.
 
IMPORT_C void SetOffset (TInt aOffset)
 Sets the offset of the link object from the start of a doubly linked list element.
 
IMPORT_C void Reset ()
 Empties the doubly linked list.
 

Additional Inherited Members

- Protected Member Functions inherited from TDblQueBase
IMPORT_C TDblQueBase ()
 Default constructor.
 
IMPORT_C TDblQueBase (TInt aOffset)
 Constructor with specified offset.
 
IMPORT_C void DoAddFirst (TAny *aPtr)
 Implements the insertion of the specified list element at the front of the doubly linked list.
 
IMPORT_C void DoAddLast (TAny *aPtr)
 Implements the insertion of the specified list element at the back of the doubly linked list.
 
IMPORT_C void DoAddPriority (TAny *aPtr)
 Implements the insertion of the specified list element in priority order.
 
IMPORT_C void __DbgTestEmpty () const
 Tests whether the queue is empty.
 
- Protected Attributes inherited from TDblQueBase
TDblQueLink iHead
 The head, or anchor point of the queue.
 
TInt iOffset
 The offset of a component link object within elements that form the list.
 

Detailed Description

template<class T>
class TPriQue< T >

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.

See also
TPriQueLink
TPriQueLink::iPriority
API status
Published to all clients. Released API.

Definition at line 482 of file e32std.h.

Constructor & Destructor Documentation

◆ TPriQue() [1/2]

template<class T >
TPriQue< T >::TPriQue ( )
inline

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.

TDblQueBase::SetOffset

(generated from Symbian Developer Library)

◆ TPriQue() [2/2]

template<class T >
TPriQue< T >::TPriQue ( TInt  aOffset)
inlineexplicit

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

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

Panic condition: USER 78 if aOffset is not divisible by four.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Add()

template<class T >
void TPriQue< T >::Add ( T &  aRef)
inline

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
aRefThe list element to be inserted.

(generated from Symbian Developer Library)

◆ First()

template<class T >
T * TPriQue< T >::First ( ) const
inline

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

(generated from Symbian Developer Library)

◆ IsFirst()

template<class T >
TBool TPriQue< T >::IsFirst ( const T *  aPtr) const
inline

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

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

(generated from Symbian Developer Library)

◆ IsHead()

template<class T >
TBool TPriQue< T >::IsHead ( const T *  aPtr) const
inline

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
aPtrThe pointer value to be checked.

(generated from Symbian Developer Library)

◆ IsLast()

template<class T >
TBool TPriQue< T >::IsLast ( const T *  aPtr) const
inline

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

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

(generated from Symbian Developer Library)

◆ Last()

template<class T >
T * TPriQue< T >::Last ( ) const
inline

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

(generated from Symbian Developer Library)


The documentation for this class was generated from the following files: