#include <oscl_queue.h>
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 () |
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.
typedef const T& Oscl_Queue< T, Alloc >::const_reference |
typedef T* Oscl_Queue< T, Alloc >::pointer |
typedef T& Oscl_Queue< T, Alloc >::reference |
typedef uint32 Oscl_Queue< T, Alloc >::size_type |
typedef T Oscl_Queue< T, Alloc >::value_type |
Oscl_Queue< T, Alloc >::Oscl_Queue | ( | ) | [inline] |
Creates an empty queue.
References Oscl_Queue_Base::construct(), and Oscl_Queue_Base::sizeof_T.
Oscl_Queue< T, Alloc >::Oscl_Queue | ( | uint32 | n | ) | [inline] |
Creates an empty queue with capacity n.
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.
virtual Oscl_Queue< T, Alloc >::~Oscl_Queue | ( | ) | [inline, virtual] |
The destructor.
References Oscl_Queue_Base::destroy().
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.
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.
void Oscl_Queue< T, Alloc >::clear | ( | ) | [inline] |
Removes all elements.
Reimplemented from Oscl_Queue_Base.
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.
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.
void Oscl_Queue< T, Alloc >::pop | ( | ) | [inline] |
Removes the first element
Reimplemented from Oscl_Queue_Base.
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
x | new element |