Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::iqueue< T > Class Template Reference

This is the base for all queues that contain a particular type. More...

#include <iqueue.h>

Public Types

typedef T value_type
 The type stored in the queue.
 
typedef T & reference
 A reference to the type used in the queue.
 
typedef const T & const_reference
 A const reference to the type used in the queue.
 
typedef T * pointer
 A pointer to the type used in the queue.
 
typedef const T * const_pointer
 A const pointer to the type used in the qu.
 
typedef queue_base::size_type size_type
 The type used for determining the size of the queue.
 
- Public Types inherited from etl::queue_base
typedef size_t size_type
 The type used for determining the size of queue.
 

Public Member Functions

reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void push (parameter_t item)
 
reference push ()
 
- Public Member Functions inherited from etl::queue_base
size_type size () const
 Returns the current number of items in the queue.
 
size_type capacity () const
 Returns the maximum number of items that can be queued.
 
size_type max_size () const
 Returns the maximum number of items that can be queued.
 
bool empty () const
 
bool full () const
 
size_t available () const
 
void clear ()
 Clears the queue to the empty state.
 
void pop ()
 

Protected Member Functions

 iqueue (T *buffer, size_type max_size)
 The constructor that is called from derived classes.
 
- Protected Member Functions inherited from etl::queue_base
 queue_base (size_type max_size)
 The constructor that is called from derived classes.
 

Additional Inherited Members

- Protected Attributes inherited from etl::queue_base
size_type in
 Where to input new data.
 
size_type out
 Where to get the oldest data.
 
size_type current_size
 The number of items in the queue.
 
const size_type MAX_SIZE
 The maximum number of items in the queue.
 

Detailed Description

template<typename T>
class etl::iqueue< T >

This is the base for all queues that contain a particular type.

Normally a reference to this type will be taken from a derived queue.

etl::iqueue<int>& iQueue = myQueue;
Warning
This queue cannot be used for concurrent access from multiple threads.
Template Parameters
TThe type of item that the queue holds.

Member Function Documentation

template<typename T>
reference etl::iqueue< T >::back ( )
inline

Gets a reference to the item at the back of the queue.

Returns
A reference to the item at the back of the queue.
template<typename T>
const_reference etl::iqueue< T >::back ( ) const
inline

Gets a const reference to the item at the back of the queue.

Returns
A const reference to the item at the back of the queue.
template<typename T>
reference etl::iqueue< T >::front ( )
inline

Gets a reference to the item at the front of the queue.

Returns
A reference to the item at the front of the queue.
template<typename T>
const_reference etl::iqueue< T >::front ( ) const
inline

Gets a const reference to the item at the front of the queue.

Returns
A const reference to the item at the front of the queue.
template<typename T>
void etl::iqueue< T >::push ( parameter_t  item)
inline

Adds an item to the queue. If ETL_THROW_EXCEPTIONS is defined, throws an etl::queue_full is the queue is already full, otherwise does nothing if full.

Parameters
itemThe item to push to the queue.
template<typename T>
reference etl::iqueue< T >::push ( )
inline

Allows a possibly more efficient 'push' by moving to the next input item and returning a reference to it. This may eliminate a copy by allowing direct construction in-place.
If ETL_THROW_EXCEPTIONS is defined, throws an etl::queue_full is the queue is already full, otherwise does nothing if full.

Returns
A reference to the position to 'push' to.

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