Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

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 Methods

 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.

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.

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

The destructor.


Member Function Documentation

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

Returns the last element (const)

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)

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)

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

Returns the first element.

Reimplemented from Oscl_Queue_Base.

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: OPENCORE_20090310