Oscl_Queue< T, Alloc > Class Template Reference
[OSCL Base]

#include <oscl_queue.h>

Inheritance diagram for Oscl_Queue< T, Alloc >:
Oscl_Queue_Base Oscl_Opaque_Type_Alloc

Public Types

typedef T value_type
typedef T * pointer
typedef T & reference
typedef const T & const_reference
typedef uint32 size_type

Public Member Functions

 Oscl_Queue ()
 Oscl_Queue (uint32 n)
virtual ~Oscl_Queue ()
void push (const T &x)
reference front ()
const_reference front () const
void pop ()
reference back ()
const_reference back () const
void clear ()

Detailed Description

template<class T, class Alloc>
class Oscl_Queue< T, Alloc >

Oscl_Queue Class. A subset of STL::Queue methods. Oscl_Queue supports constant time insertion (at the end) and removal of elements at the front of the queue. It does not support insertion or removal of elements at the other ends or middle of the queue, nor random access to elements. * No iteration capability is [currently] supplied. * No assignment or copy capability is [currently] supplied. The number of elements in a queue can vary dynamically, and memory management is performed automatically.


Member Typedef Documentation

template<class T, class Alloc>
typedef const T& Oscl_Queue< T, Alloc >::const_reference
template<class T, class Alloc>
typedef T* Oscl_Queue< T, Alloc >::pointer
template<class T, class Alloc>
typedef T& Oscl_Queue< T, Alloc >::reference
template<class T, class Alloc>
typedef uint32 Oscl_Queue< T, Alloc >::size_type
template<class T, class Alloc>
typedef T Oscl_Queue< T, Alloc >::value_type

Constructor & Destructor Documentation

template<class T, class Alloc>
Oscl_Queue< T, Alloc >::Oscl_Queue (  )  [inline]

Creates an empty queue.

References Oscl_Queue_Base::construct(), and Oscl_Queue_Base::sizeof_T.

template<class T, class Alloc>
Oscl_Queue< T, Alloc >::Oscl_Queue ( uint32  n  )  [inline]

Creates an empty queue with capacity n.

Parameters:
n creates a queue with n elements. The main reason for specifying n is efficiency. If you know the capacity to which your queue must grow, then it is more efficient to allocate the queue all at once rather than rely on the automatic reallocation scheme.

References Oscl_Queue_Base::construct(), and Oscl_Queue_Base::sizeof_T.

template<class T, class Alloc>
virtual Oscl_Queue< T, Alloc >::~Oscl_Queue (  )  [inline, virtual]

The destructor.

References Oscl_Queue_Base::destroy().


Member Function Documentation

template<class T, class Alloc>
const_reference Oscl_Queue< T, Alloc >::back (  )  const [inline]

Returns the last element (const)

References Oscl_Queue_Base::elems, Oscl_Queue_Base::empty(), Oscl_Queue_Base::irear, and OSCL_ASSERT.

template<class T, class Alloc>
reference Oscl_Queue< T, Alloc >::back (  )  [inline]

Returns the last element: "back" (generally not too useful, but some debugging aids might want to find out what was just added)

References Oscl_Queue_Base::elems, Oscl_Queue_Base::empty(), Oscl_Queue_Base::irear, and OSCL_ASSERT.

template<class T, class Alloc>
void Oscl_Queue< T, Alloc >::clear (  )  [inline]

Removes all elements.

Reimplemented from Oscl_Queue_Base.

template<class T, class Alloc>
const_reference Oscl_Queue< T, Alloc >::front (  )  const [inline]

Returns the first element (const)

References Oscl_Queue_Base::elems, Oscl_Queue_Base::empty(), Oscl_Queue_Base::ifront, and OSCL_ASSERT.

template<class T, class Alloc>
reference Oscl_Queue< T, Alloc >::front (  )  [inline]

Returns the first element.

Reimplemented from Oscl_Queue_Base.

References Oscl_Queue_Base::elems, Oscl_Queue_Base::empty(), Oscl_Queue_Base::ifront, and OSCL_ASSERT.

template<class T, class Alloc>
void Oscl_Queue< T, Alloc >::pop (  )  [inline]

Removes the first element

Reimplemented from Oscl_Queue_Base.

template<class T, class Alloc>
void Oscl_Queue< T, Alloc >::push ( const T &  x  )  [inline]

Inserts a new element at the end. Queue will be grown if necessary. If allocation fails, an OSCL_LEAVE will occur

Parameters:
x new element

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

OSCL API
Posting Version: CORE_9.002.1.1