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

A templated class that provides the behaviour for managing a singly linked list. More...

#include <e32std.h>

Inheritance diagram for TSglQue< T >:
TSglQueBase

Public Member Functions

 TSglQue ()
 Constructs an empty list header and sets the offset value of the link object to zero.
 
 TSglQue (TInt aOffset)
 Constructs an empty list header and sets the offset of the link object to the specified value.
 
void AddFirst (T &aRef)
 Inserts the specified list element at the front of the singly linked list.
 
void AddLast (T &aRef)
 Inserts the specified list element at the back of the singly linked list.
 
TBool IsFirst (const T *aPtr) const
 Tests whether the specified element is the first in the singly linked list.
 
TBool IsLast (const T *aPtr) const
 Tests whether the specified element is the last in the singly linked list.
 
T * First () const
 Gets a pointer to the first list element in the singly linked list.
 
T * Last () const
 Gets a pointer to the last list element in the singly linked list.
 
void Remove (T &aRef)
 Removes the specified element from the singly linked list.
 
- Public Member Functions inherited from TSglQueBase
IMPORT_C TBool IsEmpty () const
 Tests whether the singly linked list is empty, i.e.
 
IMPORT_C void SetOffset (TInt aOffset)
 Sets the offset of the link object from the start of a singly linked list element.
 
IMPORT_C void Reset ()
 Empties the singly linked list.
 

Additional Inherited Members

- Protected Member Functions inherited from TSglQueBase
IMPORT_C TSglQueBase ()
 Default constructor.
 
IMPORT_C TSglQueBase (TInt aOffset)
 Constructor with specified offset.
 
IMPORT_C void DoAddFirst (TAny *aPtr)
 Implements the insertion of a list element at the front of the singly linked list.
 
IMPORT_C void DoAddLast (TAny *aPtr)
 Implements the insertion of a list element at the back of the singly linked list.
 
IMPORT_C void DoRemove (TAny *aPtr)
 Implements the removal of a list element from the singly linked list.
 
- Protected Attributes inherited from TSglQueBase
TSglQueLink * iHead
 A pointer to the first element in the list.
 
TSglQueLink * iLast
 A pointer to the last element in the list.
 
TInt iOffset
 The offset of a component link object within elements that form the list.
 

Detailed Description

template<class T>
class TSglQue< T >

A templated class that provides the behaviour for managing a singly linked list.

It also acts as the head of the list, maintaining the pointers into the list.

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

See also
TSglQueLink
API status
Published to all clients. Released API.

Definition at line 412 of file e32std.h.

Constructor & Destructor Documentation

◆ TSglQue() [1/2]

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

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.

TSglQueBase::SetOffset

(generated from Symbian Developer Library)

◆ TSglQue() [2/2]

template<class T >
TSglQue< T >::TSglQue ( 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 75, if aOffset is not divisible by four.

(generated from Symbian Developer Library)

Member Function Documentation

◆ AddFirst()

template<class T >
void TSglQue< T >::AddFirst ( T &  aRef)
inline

Inserts the specified list element at the front of the singly linked list.

If the list is not empty, the specified element becomes the first in the list. What was previously the first element becomes the second in the list.

Parameters
aRefThe list element to be inserted at the front of the singly linked list.

(generated from Symbian Developer Library)

◆ AddLast()

template<class T >
void TSglQue< T >::AddLast ( T &  aRef)
inline

Inserts the specified list element at the back of the singly linked list.

If the list is not empty, the specified element becomes the last in the list. What was previously the last element becomes the next to last element in the list.

Parameters
aRefThe list element to be inserted at the back of the singly linked list.

(generated from Symbian Developer Library)

◆ First()

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

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

(generated from Symbian Developer Library)

◆ IsFirst()

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

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

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

(generated from Symbian Developer Library)

◆ IsLast()

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

Tests whether the specified element is the last in the singly 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 * TSglQue< T >::Last ( ) const
inline

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

(generated from Symbian Developer Library)

◆ Remove()

template<class T >
void TSglQue< T >::Remove ( T &  aRef)
inline

Removes the specified element from the singly linked list.

The singly linked list must not be empty.

Parameters
aRefA list element to be removed from the singly linked list.

Panic condition: USER 76, if the element to be removed is not in the list

(generated from Symbian Developer Library)


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