Loading...
Searching...
No Matches
queue

## Classes

class | etl::intrusive_queue_base< TLink >
class | etl::intrusive_queue< TValue, TLink >
class | etl::priority_queue_exception
class | etl::priority_queue_full
class | etl::priority_queue_iterator
class | etl::priority_queue_empty
class | etl::ipriority_queue< T, TContainerBase, TCompare >
| This is the base for all priority queues that contain a particular type. More...
class | etl::queue_exception
class | etl::queue_full
class | etl::queue_empty
class | etl::queue_base< MEMORY_MODEL >
class | etl::iqueue< T, MEMORY_MODEL >
| This is the base for all queues that contain a particular type. More...
class | etl::queue< T, SIZE, MEMORY_MODEL >
class | etl::queue_lockable_exception
class | etl::queue_lockable_empty
class | etl::queue_spsc_isr_exception
class | etl::queue_spsc_isr_empty
class | etl::queue_spsc_locked_exception
class | etl::queue_spsc_locked_empty

## Detailed Description

A priority queue with the capacity defined at compile time, written in the STL style.

A First-in / first-out queue with the capacity defined at compile time, written in the STL style.

## Class Documentation

## etl::intrusive_queue_base

class etl::intrusive_queue_base

template<typename TLink>
class etl::intrusive_queue_base< TLink >

Base for intrusive queue. Stores elements derived any ETL type that supports an 'etl_next' pointer member.

Template Parameters

  TLink | The link type that the value is derived from.

### Public Types

typedef TLink | link_type

### Public Member Functions

void | push (link_type &value)
void | pop ()
template<typename TContainer>
void | pop_into (TContainer &destination)
void | clear ()
| Clears the queue to the empty state.
bool | empty () const
| Checks if the queue is in the empty state.
size_t | size () const
| Returns the number of elements.

### Protected Member Functions

| intrusive_queue_base ()
| Constructor.
| ~intrusive_queue_base ()
| Destructor.

### Protected Attributes

link_type * | p_back
| Pointer to the current back of the queue.
link_type | terminator
size_t | current_size
| Counts the number of elements in the list.

#### Member Function Documentation

## pop()

template<typename TLink>

void etl::intrusive_queue_base< TLink >::pop | ( |  | ) |

inline

Removes the oldest item from the queue. Undefined behaviour if the queue is already empty.

## pop_into()

template<typename TLink>
template<typename TContainer>

void etl::intrusive_queue_base< TLink >::pop_into | ( | TContainer & | destination | ) |

inline

Removes the oldest item from the queue and pushes it to the destination. Undefined behaviour if the queue is already empty. NOTE: The destination must be an intrusive container that supports a push(TLink) member function.

## push()

template<typename TLink>

void etl::intrusive_queue_base< TLink >::push | ( | link_type & | value | ) |

inline

Adds a value to the queue.

Parameters

  value | The value to push to the queue.

#### Member Data Documentation

## terminator

template<typename TLink>

link_type etl::intrusive_queue_base< TLink >::terminator

protected

This link terminates the queue and points to the front of the queue.

## etl::intrusive_queue

class etl::intrusive_queue

template<typename TValue, typename TLink>
class etl::intrusive_queue< TValue, TLink >

An intrusive queue. Stores elements derived from any type that supports an 'etl_next' pointer member.

Warning
  This queue cannot be used for concurrent access from multiple threads.

Template Parameters

  TValue | The type of value that the queue holds.
  TLink | The link type that the value is derived from.

### Public Types

typedef etl::intrusive_queue_base< TLink > | link_type
typedef TValue | value_type
typedef value_type * | pointer
typedef const value_type * | const_pointer
typedef value_type & | reference
typedef const value_type & | const_reference
typedef size_t | size_type
Public Types inherited from etl::intrusive_queue_base< TLink >
typedef TLink | link_type

### Public Member Functions

| intrusive_queue ()
| Constructor.
reference | front ()
reference | back ()
const_reference | front () const
const_reference | back () const
Public Member Functions inherited from etl::intrusive_queue_base< TLink >
void | push (link_type &value)
void | pop ()
template<typename TContainer>
void | pop_into (TContainer &destination)
void | clear ()
| Clears the queue to the empty state.
bool | empty () const
| Checks if the queue is in the empty state.
size_t | size () const
| Returns the number of elements.

## Additional Inherited Members

Protected Member Functions inherited from etl::intrusive_queue_base< TLink >
| intrusive_queue_base ()
| Constructor.
| ~intrusive_queue_base ()
| Destructor.
Protected Attributes inherited from etl::intrusive_queue_base< TLink >
link_type * | p_back
| Pointer to the current back of the queue.
link_type | terminator
size_t | current_size
| Counts the number of elements in the list.

#### Member Function Documentation

## back() [1/2]

template<typename TValue, typename TLink>

reference etl::intrusive_queue< TValue, TLink >::back | ( |  | ) |

inline

Gets a reference to the value at the back of the queue. If asserts or exceptions are enabled, throws an etl::intrusive_queue_empty if the queue is empty.

Returns
  A reference to the value at the back of the queue.

## back() [2/2]

template<typename TValue, typename TLink>

const_reference etl::intrusive_queue< TValue, TLink >::back | ( |  | ) | const

inline

Gets a reference to the value at the back of the queue. If asserts or exceptions are enabled, throws an etl::intrusive_queue_empty if the queue is empty.

Returns
  A reference to the value at the back of the queue.

## front() [1/2]

template<typename TValue, typename TLink>

reference etl::intrusive_queue< TValue, TLink >::front | ( |  | ) |

inline

Gets a reference to the value at the front of the queue. If asserts or exceptions are enabled, throws an etl::intrusive_queue_empty if the queue is empty.

Returns
  A reference to the value at the front of the queue.

## front() [2/2]

template<typename TValue, typename TLink>

const_reference etl::intrusive_queue< TValue, TLink >::front | ( |  | ) | const

inline

Gets a const reference to the value at the front of the queue. If asserts or exceptions are enabled, throws an etl::intrusive_queue_empty if the queue is empty.

Returns
  A const reference to the value at the front of the queue.

## etl::priority_queue_exception

class etl::priority_queue_exception

The base class for priority_queue exceptions.

### Public Member Functions

| priority_queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::priority_queue_full

class etl::priority_queue_full

The exception thrown when the queue is full.

### Public Member Functions

| priority_queue_full (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::priority_queue_exception
| priority_queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::priority_queue_iterator

class etl::priority_queue_iterator

The priority queue iterator exception on reversed iterators

### Public Member Functions

| priority_queue_iterator (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::priority_queue_exception
| priority_queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::priority_queue_empty

class etl::priority_queue_empty

The exception thrown when the queue is empty.

### Public Member Functions

| priority_queue_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::priority_queue_exception
| priority_queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::ipriority_queue

class etl::ipriority_queue

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
class etl::ipriority_queue< T, TContainerBase, TCompare >

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

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

etl::priority_queue<int, 10> myPriorityQueue;
etl::ipriority_queue<int>& iQueue = myPriorityQueue;
etl::priority_queue
Definition priority_queue.h:527
etl::ipriority_queue
This is the base for all priority queues that contain a particular type.
Definition priority_queue.h:153

Warning
  This priority queue cannot be used for concurrent access from multiple threads.

Template Parameters

  T | The type of value that the queue holds.
  TContainerBase | The non-sized base class of the underlying container (e.g. etl::ivector<T>)
  TCompare | to use in comparing T values

### Public Types

typedef T | value_type
| The type stored in the queue.
typedef TCompare | compare_type
| The comparison type.
typedef TContainerBase | container_base_type
| The non-sized container base type.
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 TContainerBase::size_type | size_type
| The type used for determining the size of the queue.
typedef TContainerBase::difference_type | difference_type

### Public Member Functions

reference | top ()
const_reference | top () const
void | push (const_reference value)
void | emplace ()
template<typename T1>
void | emplace (const T1 &value1)
template<typename T1, typename T2>
void | emplace (const T1 &value1, const T2 &value2)
template<typename T1, typename T2, typename T3>
void | emplace (const T1 &value1, const T2 &value2, const T3 &value3)
template<typename T1, typename T2, typename T3, typename T4>
void | emplace (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
template<typename TIterator>
void | assign (TIterator first, TIterator last)
void | pop ()
void | pop_into (reference destination)
size_type | size () const
| Returns the current number of items in the priority queue.
size_type | max_size () const
| Returns the maximum number of items that can be queued.
bool | empty () const
bool | full () const
size_type | available () const
void | clear ()
| Clears the queue to the empty state.
ipriority_queue & | operator= (const ipriority_queue &rhs)
| Assignment operator.

### Protected Member Functions

| ~ipriority_queue ()
| Destructor.
| ipriority_queue (TContainerBase &container_)
| The constructor that is called from derived classes.

#### Member Function Documentation

## assign()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
template<typename TIterator>

void etl::ipriority_queue< T, TContainerBase, TCompare >::assign | ( | TIterator | first,
|  | TIterator | last )

inline

Assigns values to the priority queue. If asserts or exceptions are enabled, emits priority_queue_full if priority queue does not have enough free space. If asserts or exceptions are enabled, emits priority_iterator if the iterators are reversed.

Parameters

  first | The iterator to the first element.
  last | The iterator to the last element + 1.

## available()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

size_type etl::ipriority_queue< T, TContainerBase, TCompare >::available | ( |  | ) | const

inline

Returns the remaining capacity.

Returns
  The remaining capacity.

## emplace() [1/5]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

void etl::ipriority_queue< T, TContainerBase, TCompare >::emplace | ( |  | ) |

inline

Emplaces a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## emplace() [2/5]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
template<typename T1>

void etl::ipriority_queue< T, TContainerBase, TCompare >::emplace | ( | const T1 & | value1 | ) |

inline

Emplaces a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## emplace() [3/5]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
template<typename T1, typename T2>

void etl::ipriority_queue< T, TContainerBase, TCompare >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2 )

inline

Emplaces a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## emplace() [4/5]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
template<typename T1, typename T2, typename T3>

void etl::ipriority_queue< T, TContainerBase, TCompare >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2,
|  | const T3 & | value3 )

inline

Emplaces a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## emplace() [5/5]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>
template<typename T1, typename T2, typename T3, typename T4>

void etl::ipriority_queue< T, TContainerBase, TCompare >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2,
|  | const T3 & | value3,
|  | const T4 & | value4 )

inline

Emplaces a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## empty()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

bool etl::ipriority_queue< T, TContainerBase, TCompare >::empty | ( |  | ) | const

inline

Checks to see if the priority queue is empty.

Returns
  true if the queue is empty, otherwise false

## full()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

bool etl::ipriority_queue< T, TContainerBase, TCompare >::full | ( |  | ) | const

inline

Checks to see if the priority queue is full.

Returns
  true if the priority queue is full, otherwise false

## pop()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

void etl::ipriority_queue< T, TContainerBase, TCompare >::pop | ( |  | ) |

inline

Removes the oldest value from the back of the priority queue. If asserts or exceptions are enabled, throws an etl::priority_queue_empty if the priority queue is empty. Does nothing if the priority queue is already empty.

## pop_into()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

void etl::ipriority_queue< T, TContainerBase, TCompare >::pop_into | ( | reference | destination | ) |

inline

Gets the highest priority value in the priority queue and assigns it to destination and removes it from the queue.

## push()

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

void etl::ipriority_queue< T, TContainerBase, TCompare >::push | ( | const_reference | value | ) |

inline

Adds a value to the queue. If asserts or exceptions are enabled, throws an etl::priority_queue_full is the priority queue is already full.

Parameters

  value | The value to push to the queue.

## top() [1/2]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

reference etl::ipriority_queue< T, TContainerBase, TCompare >::top | ( |  | ) |

inline

Gets a reference to the highest priority value in the priority queue. If asserts or exceptions are enabled, throws an etl::priority_queue_empty if the priority queue is empty.

Returns
  A reference to the highest priority value in the priority queue.

## top() [2/2]

template<typename T, typename TContainerBase = etl::ivector<T>, typename TCompare = etl::less<T>>

const_reference etl::ipriority_queue< T, TContainerBase, TCompare >::top | ( |  | ) | const

inline

Gets a const reference to the highest priority value in the priority queue. If asserts or exceptions are enabled, throws an etl::priority_queue_empty if the priority queue is empty.

Returns
  A const reference to the highest priority value in the priority queue.

## etl::queue_exception

class etl::queue_exception

The base class for queue exceptions.

### Public Member Functions

| queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_full

class etl::queue_full

The exception thrown when the queue is full.

### Public Member Functions

| queue_full (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::queue_exception
| queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_empty

class etl::queue_empty

The exception thrown when the queue is empty.

### Public Member Functions

| queue_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::queue_exception
| queue_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_base

class etl::queue_base

template<size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
class etl::queue_base< MEMORY_MODEL >

The base class for all queues.

### Public Types

typedef etl::size_type_lookup< MEMORY_MODEL >::type | size_type
| The type used for determining the size of queue.

### Public Member Functions

size_type | size () const
| Returns the current number of items in the queue.
size_type | max_size () const
| Returns the maximum number of items that can be queued.
size_type | capacity () const
| Returns the maximum number of items that can be queued.
bool | empty () const
bool | full () const
size_type | available () const

### Protected Member Functions

| queue_base (size_type max_size_)
| The constructor that is called from derived classes.
| ~queue_base ()
| Destructor.
void | add_in ()
| Increments (and wraps) the 'in' index value to record a queue addition.
void | del_out ()
| Increments (and wraps) the 'out' index value to record a queue deletion.
void | index_clear ()
| Clears the indexes.

### Protected Attributes

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 | CAPACITY
| The maximum number of items in the queue.
| ETL_DECLARE_DEBUG_COUNT
| For internal debugging purposes.

#### Member Function Documentation

## available()

template<size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

size_type etl::queue_base< MEMORY_MODEL >::available | ( |  | ) | const

inline

Returns the remaining capacity.

Returns
  The remaining capacity.

## empty()

template<size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

bool etl::queue_base< MEMORY_MODEL >::empty | ( |  | ) | const

inline

Checks to see if the queue is empty.

Returns
  true if the queue is empty, otherwise false

## full()

template<size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

bool etl::queue_base< MEMORY_MODEL >::full | ( |  | ) | const

inline

Checks to see if the queue is full.

Returns
  true if the queue is full, otherwise false

## etl::iqueue

class etl::iqueue

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
class etl::iqueue< T, MEMORY_MODEL >

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::queue<int, 10> myQueue;
etl::iqueue<int>& iQueue = myQueue;
etl::iqueue
This is the base for all queues that contain a particular type.
Definition queue.h:238
etl::queue
Definition queue.h:625

Warning
  This queue cannot be used for concurrent access from multiple threads.

Template Parameters

  T | The type of value that the queue holds.

### 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 queue.
typedef base_t::size_type | size_type
| The type used for determining the size of the queue.
Public Types inherited from etl::queue_base< etl::memory_model::MEMORY_MODEL_LARGE >
typedef etl::size_type_lookup< MEMORY_MODEL >::type | 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 (const_reference value)
reference | emplace ()
template<typename T1>
reference | emplace (const T1 &value1)
template<typename T1, typename T2>
reference | emplace (const T1 &value1, const T2 &value2)
template<typename T1, typename T2, typename T3>
reference | emplace (const T1 &value1, const T2 &value2, const T3 &value3)
template<typename T1, typename T2, typename T3, typename T4>
reference | emplace (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
void | clear ()
| Clears the queue to the empty state.
void | pop ()
void | pop_into (reference destination)
template<typename TContainer>
void | pop_into (TContainer &destination)
iqueue & | operator= (const iqueue &rhs)
| Assignment operator.
void | add_in ()
| Increments (and wraps) the 'in' index value to record a queue addition.
void | del_out ()
| Increments (and wraps) the 'out' index value to record a queue deletion.
bool | empty () const
bool | full () const
Public Member Functions inherited from etl::queue_base< etl::memory_model::MEMORY_MODEL_LARGE >
size_type | size () const
| Returns the current number of items in the queue.
size_type | max_size () const
| Returns the maximum number of items that can be queued.
size_type | capacity () const
| Returns the maximum number of items that can be queued.
bool | empty () const
bool | full () const
size_type | available () const

### Public Attributes

const size_type | CAPACITY
| The maximum number of items in the queue.
size_type | current_size
| The number of items in the queue.
size_type | in
| Where to input new data.
size_type | out
| Where to get the oldest data.

### Protected Member Functions

void | clone (const iqueue &other)
| Make this a clone of the supplied queue.
| iqueue (T *p_buffer_, size_type max_size_)
| The constructor that is called from derived classes.
| ~iqueue ()
| Destructor.
Protected Member Functions inherited from etl::queue_base< etl::memory_model::MEMORY_MODEL_LARGE >
| queue_base (size_type max_size_)
| The constructor that is called from derived classes.
| ~queue_base ()
| Destructor.
void | add_in ()
| Increments (and wraps) the 'in' index value to record a queue addition.
void | del_out ()
| Increments (and wraps) the 'out' index value to record a queue deletion.
void | index_clear ()
| Clears the indexes.

## Additional Inherited Members

Protected Attributes inherited from etl::queue_base< etl::memory_model::MEMORY_MODEL_LARGE >
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 | CAPACITY
| The maximum number of items in the queue.
| ETL_DECLARE_DEBUG_COUNT
| For internal debugging purposes.

#### Member Function Documentation

## back() [1/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

reference etl::iqueue< T, MEMORY_MODEL >::back | ( |  | ) |

inline

Gets a reference to the value at the back of the queue. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

Returns
  A reference to the value at the back of the queue.

## back() [2/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

const_reference etl::iqueue< T, MEMORY_MODEL >::back | ( |  | ) | const

inline

Gets a const reference to the value at the back of the queue. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

Returns
  A const reference to the value at the back of the queue.

## emplace() [1/5]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

reference etl::iqueue< T, MEMORY_MODEL >::emplace | ( |  | ) |

inline

Constructs a default constructed value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

## emplace() [2/5]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1>

reference etl::iqueue< T, MEMORY_MODEL >::emplace | ( | const T1 & | value1 | ) |

inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

Parameters

  value1 | The argument to use to construct the item to push to the queue.

## emplace() [3/5]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1, typename T2>

reference etl::iqueue< T, MEMORY_MODEL >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2 )

inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

Parameters

  value1 | The first argument to use to construct the item to push to the queue.
  value2 | The second argument to use to construct the item to push to the queue.

## emplace() [4/5]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1, typename T2, typename T3>

reference etl::iqueue< T, MEMORY_MODEL >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2,
|  | const T3 & | value3 )

inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

Parameters

  value1 | The first argument to use to construct the item to push to the queue.
  value2 | The second argument to use to construct the item to push to the queue.
  value3 | The third argument to use to construct the item to push to the queue.

## emplace() [5/5]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1, typename T2, typename T3, typename T4>

reference etl::iqueue< T, MEMORY_MODEL >::emplace | ( | const T1 & | value1,
|  | const T2 & | value2,
|  | const T3 & | value3,
|  | const T4 & | value4 )

inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

Parameters

  value1 | The first argument to use to construct the item to push to the queue.
  value2 | The second argument to use to construct the item to push to the queue.
  value3 | The third argument to use to construct the item to push to the queue.
  value4 | The fourth argument to use to construct the item to push to the queue.

## empty()

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

bool etl::queue_base< MEMORY_MODEL >::empty | ( |  | ) | const

inline

Checks to see if the queue is empty.

Returns
  true if the queue is empty, otherwise false

## front() [1/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

reference etl::iqueue< T, MEMORY_MODEL >::front | ( |  | ) |

inline

Gets a reference to the value at the front of the queue. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

Returns
  A reference to the value at the front of the queue.

## front() [2/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

const_reference etl::iqueue< T, MEMORY_MODEL >::front | ( |  | ) | const

inline

Gets a const reference to the value at the front of the queue. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

Returns
  A const reference to the value at the front of the queue.

## full()

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

bool etl::queue_base< MEMORY_MODEL >::full | ( |  | ) | const

inline

Checks to see if the queue is full.

Returns
  true if the queue is full, otherwise false

## pop()

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

void etl::iqueue< T, MEMORY_MODEL >::pop | ( |  | ) |

inline

Removes the oldest value from the front of the queue. Does nothing if the queue is already empty. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

## pop_into() [1/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

void etl::iqueue< T, MEMORY_MODEL >::pop_into | ( | reference | destination | ) |

inline

Gets the oldest value and removes it from the front of the queue. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.

## pop_into() [2/2]

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename TContainer>

void etl::iqueue< T, MEMORY_MODEL >::pop_into | ( | TContainer & | destination | ) |

inline

Gets the oldest value and removes it from the front of the queue and pushes it to the destination container. If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty. NOTE: The destination must support a push(T) member function.

## push()

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>

void etl::iqueue< T, MEMORY_MODEL >::push | ( | const_reference | value | ) |

inline

Adds a value to the queue. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

Parameters

  value | The value to push to the queue.

## etl::queue

class etl::queue

template<typename T, const size_t SIZE, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
class etl::queue< T, SIZE, MEMORY_MODEL >

A fixed capacity queue. This queue does not support concurrent access by different threads.

Template Parameters

  T | The type this queue should support.
  SIZE | The maximum capacity of the queue.
  MEMORY_MODEL | The memory model for the queue. Determines the type of the internal counter variables.

### Public Types

typedef base_t::size_type | size_type
typedef etl::aligned_storage< sizeof(T), etl::alignment_of< T >::value >::type | container_type
Public Types inherited from etl::iqueue< T, etl::memory_model::MEMORY_MODEL_LARGE >
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 queue.
typedef base_t::size_type | size_type
| The type used for determining the size of the queue.
Public Types inherited from etl::queue_base< MEMORY_MODEL >
typedef etl::size_type_lookup< MEMORY_MODEL >::type | size_type
| The type used for determining the size of queue.

### Public Member Functions

| ETL_STATIC_ASSERT ((SIZE<=etl::integral_limits< size_type >::max), "Size too large for memory model")
| queue ()
| Default constructor.
| queue (const queue &rhs)
| Copy constructor.
| ~queue ()
| Destructor.
queue & | operator= (const queue &rhs)
| Assignment operator.
Public Member Functions inherited from etl::iqueue< T, etl::memory_model::MEMORY_MODEL_LARGE >
void | add_in ()
| Increments (and wraps) the 'in' index value to record a queue addition.
void | del_out ()
| Increments (and wraps) the 'out' index value to record a queue deletion.
bool | empty () const
bool | full () const
reference | front ()
reference | back ()
void | push (const_reference value)
reference | emplace ()
void | clear ()
| Clears the queue to the empty state.
void | pop ()
void | pop_into (reference destination)
iqueue & | operator= (const iqueue &rhs)
| Assignment operator.
Public Member Functions inherited from etl::queue_base< MEMORY_MODEL >
size_type | size () const
| Returns the current number of items in the queue.
size_type | max_size () const
| Returns the maximum number of items that can be queued.
size_type | capacity () const
| Returns the maximum number of items that can be queued.
bool | empty () const
bool | full () const
size_type | available () const

### Static Public Attributes

static ETL_CONSTANT size_type | MAX_SIZE = size_type(SIZE)

## Additional Inherited Members

Public Attributes inherited from etl::iqueue< T, etl::memory_model::MEMORY_MODEL_LARGE >
const size_type | CAPACITY
| The maximum number of items in the queue.
size_type | current_size
| The number of items in the queue.
size_type | in
| Where to input new data.
size_type | out
| Where to get the oldest data.
Protected Member Functions inherited from etl::iqueue< T, etl::memory_model::MEMORY_MODEL_LARGE >
void | clone (const iqueue &other)
| Make this a clone of the supplied queue.
| iqueue (T *p_buffer_, size_type max_size_)
| The constructor that is called from derived classes.
| ~iqueue ()
| Destructor.
Protected Member Functions inherited from etl::queue_base< MEMORY_MODEL >
| queue_base (size_type max_size_)
| The constructor that is called from derived classes.
| ~queue_base ()
| Destructor.
void | add_in ()
| Increments (and wraps) the 'in' index value to record a queue addition.
void | del_out ()
| Increments (and wraps) the 'out' index value to record a queue deletion.
void | index_clear ()
| Clears the indexes.
Protected Attributes inherited from etl::queue_base< MEMORY_MODEL >
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 | CAPACITY
| The maximum number of items in the queue.
| ETL_DECLARE_DEBUG_COUNT
| For internal debugging purposes.

## etl::queue_lockable_exception

class etl::queue_lockable_exception

The base class for queue exceptions.

### Public Member Functions

| queue_lockable_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_lockable_empty

class etl::queue_lockable_empty

The exception thrown when the queue is empty.

### Public Member Functions

| queue_lockable_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::queue_lockable_exception
| queue_lockable_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_spsc_isr_exception

class etl::queue_spsc_isr_exception

The base class for queue exceptions.

### Public Member Functions

| queue_spsc_isr_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_spsc_isr_empty

class etl::queue_spsc_isr_empty

The exception thrown when the queue is empty.

### Public Member Functions

| queue_spsc_isr_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::queue_spsc_isr_exception
| queue_spsc_isr_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_spsc_locked_exception

class etl::queue_spsc_locked_exception

The base class for queue exceptions.

### Public Member Functions

| queue_spsc_locked_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::queue_spsc_locked_empty

class etl::queue_spsc_locked_empty

The exception thrown when the queue is empty.

### Public Member Functions

| queue_spsc_locked_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::queue_spsc_locked_exception
| queue_spsc_locked_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type