Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <usbcque.h>
This item is not part of the S60 5th Edition SDK

Class TSglQue

class TSglQue : public TSglQueBase;

Description

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.

Derivation

Members

Defined in TSglQue:

Inherited from TSglQueBase:

See also:


Construction and destruction


TSglQue(TInt)

inline TSglQue(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

75, if aOffset is not divisible by four.


TSglQue()

inline TSglQue();

Description

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 TSglQueBase::SetOffset(TInt) function of the base class to ensure that the offset value is set correctly.

See also:


TSglQue(TInt)

inline TSglQue(TInt aOffset);

Description

Parameters

TInt aOffset

[Top]


Member functions


AddLast(T &)

inline void AddLast(T &aRef);

Description

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

T &aRef

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


Remove(T &)

inline void Remove(T &aRef);

Description

Removes the specified element from the singly linked list.

The singly linked list must not be empty.

Parameters

T &aRef

A list element to be removed from the singly linked list.

Panic codes

USER

76, if the element to be removed is not in the list


Elements()const

inline TInt Elements() const;

Description

Return value

TInt


AddFirst(T &)

inline void AddFirst(T &aRef);

Description

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

T &aRef

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


AddLast(T &)

inline void AddLast(T &aRef);

Description

Parameters

T &aRef


IsFirst(const T *)const

inline TBool IsFirst(const T *aPtr) const;

Description

Tests whether the specified element is the first in the singly 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(const T *)const

inline TBool IsLast(const T *aPtr) const;

Description

Tests whether the specified element is the last in the singly 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()const

inline T* First() const;

Description

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

Return value

T *

A pointer to the first list element in the singly 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()const

inline T* Last() const;

Description

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

Return value

T *

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


Remove(T &)

inline void Remove(T &aRef);

Description

Parameters

T &aRef