Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

intrusive_queue_base< TLink > Class Template Reference

intrusive_queue_base< TLink > Class Template Reference
[queue]

Base for intrusive queue. More...

#include <intrusive_queue.h>

Inherited by intrusive_queue< TValue, TLink >.

Public Member Functions

void push (link_type &value)
 Adds a value to the queue.
void pop ()
 Removes the oldest item from the queue.
template<typename TContainer >
void pop_into (TContainer &destination)
 Removes the oldest item from the queue and pushes it to the 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.

Protected Attributes

link_type * p_front
 The current front of the queue.
link_type * p_back
 The current back of the queue.
size_t current_size
 Counts the number of elements in the list.

Detailed Description

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

Base for intrusive queue.

Stores elements derived any type that supports an 'etl_next' pointer member.

Template Parameters:
TLinkThe link type that the value is derived from.

Definition at line 79 of file intrusive_queue.h.


Constructor & Destructor Documentation

intrusive_queue_base (  ) [protected]

Constructor.

Definition at line 177 of file intrusive_queue.h.


Member Function Documentation

void clear (  )

Clears the queue to the empty state.

Definition at line 146 of file intrusive_queue.h.

bool empty (  ) const

Checks if the queue is in the empty state.

Definition at line 159 of file intrusive_queue.h.

void pop (  )

Removes the oldest item from the queue.

Undefined behaviour if the queue is already empty.

Definition at line 112 of file intrusive_queue.h.

void pop_into ( TContainer &  destination )

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 intrusize container that supports a push(TLink) member function.

Definition at line 136 of file intrusive_queue.h.

void push ( link_type &  value )

Adds a value to the queue.

Parameters:
valueThe value to push to the queue.

Definition at line 90 of file intrusive_queue.h.

size_t size (  ) const

Returns the number of elements.

Definition at line 167 of file intrusive_queue.h.


Field Documentation

size_t current_size [protected]

Counts the number of elements in the list.

Definition at line 187 of file intrusive_queue.h.

link_type* p_back [protected]

The current back of the queue.

Definition at line 185 of file intrusive_queue.h.

link_type* p_front [protected]

The current front of the queue.

Definition at line 184 of file intrusive_queue.h.