A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd

intrusive_queue

An intrusive queue.
STL equivalent: None

etl::intrusive_queue<typename TValue, typename TLink>

TValue is the type that contains the actual values. It is derived from TLink.
TLink is the link type for this list. It must contain an etl_next pointer member.
See Intrusive links.

Member types

link_type       TLink
value_type      TValue
size_type       std::size_t
pointer         value_type*
const_pointer   const value_type*
reference       value_type&
const_reference const value_type&

Constructor

etl::intrusive_queue<typename TValue, typename TLink>();

Element access

T& front()
const T& front() const
Returns a reference or const reference to the first element.

T& back()
const T& back() const
Returns a reference or const reference to the last element.

Capacity

bool empty() const
Returns true if the size of the queue is zero, otherwise false.

bool full() const
Returns true if the size of the queue is SIZE, otherwise false.

size_t size() const
Returns the size of the queue.

size_t available() const
Returns the remaining available capacity in the queue.

size_t max_size() const
Returns the maximum possible size of the queue.

size_t capacity() const
Returns the maximum possible size of the queue.

Modifiers

void push(link_type& value);
Pushes a value to the back of the queue.

void pop();
Pop a value from the front of the queue.
Emits an etl::intrusive_queue_empty if the queue is empty and ETL_CHECK_PUSH_POP is defined.

template <typename TContainer>
void pop_into(TContainer& destination);
Pop a value from the front of the queue and push to the destination intrusive container.
The destination container type must support a push(TLink) member function.
Emits an etl::intrusive_queue_empty if the queue is empty and ETL_CHECK_PUSH_POP is defined.

void clear();
Clears the queue to a size of zero.
intrusive_queue.h