31#ifndef ETL_INTRUSIVE_QUEUE_INCLUDED
32#define ETL_INTRUSIVE_QUEUE_INCLUDED
51 intrusive_queue_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
52 :
exception(reason_, file_name_, line_number_)
61 class intrusive_queue_empty :
public intrusive_queue_exception
65 intrusive_queue_empty(string_type file_name_, numeric_type line_number_)
66 : intrusive_queue_exception(ETL_ERROR_TEXT(
"intrusive_queue:empty", ETL_INTRUSIVE_QUEUE_FILE_ID
"A"), file_name_, line_number_)
75 class intrusive_queue_value_is_already_linked :
public intrusive_queue_exception
79 intrusive_queue_value_is_already_linked(string_type file_name_, numeric_type line_number_)
80 : intrusive_queue_exception(ETL_ERROR_TEXT(
"intrusive_queue:value is already linked", ETL_INTRUSIVE_QUEUE_FILE_ID
"B"), file_name_, line_number_)
90 template <
typename TLink>
96 typedef TLink link_type;
112 p_back->etl_next = &value;
131 link_type* p_next = p_front->etl_next;
149 template <
typename TContainer>
154 destination.push(*p_link);
218 template <
typename TValue,
typename TLink>
227 typedef TValue value_type;
228 typedef value_type* pointer;
229 typedef const value_type* const_pointer;
230 typedef value_type& reference;
231 typedef const value_type& const_reference;
232 typedef size_t size_type;
249 return *
static_cast<TValue*
>(this->
terminator.etl_next);
259 return *
static_cast<TValue*
>(this->
p_back);
269 return *
static_cast<const TValue*
>(this->
terminator.etl_next);
279 return *
static_cast<const TValue*
>(this->
p_back);
Definition intrusive_queue.h:62
Definition intrusive_queue.h:76
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition exception.h:69
Definition exception.h:47
void pop_into(TContainer &destination)
Definition intrusive_queue.h:150
const_reference front() const
Definition intrusive_queue.h:267
const_reference back() const
Definition intrusive_queue.h:277
reference back()
Definition intrusive_queue.h:257
size_t current_size
Counts the number of elements in the list.
Definition intrusive_queue.h:208
void pop()
Definition intrusive_queue.h:125
link_type terminator
This link terminates the queue and points to the front of the queue.
Definition intrusive_queue.h:206
bool empty() const
Checks if the queue is in the empty state.
Definition intrusive_queue.h:173
intrusive_queue()
Constructor.
Definition intrusive_queue.h:237
~intrusive_queue_base()
Destructor.
Definition intrusive_queue.h:201
void push(link_type &value)
Definition intrusive_queue.h:102
reference front()
Definition intrusive_queue.h:247
link_type * p_back
Pointer to the current back of the queue.
Definition intrusive_queue.h:205
void clear()
Clears the queue to the empty state.
Definition intrusive_queue.h:160
intrusive_queue_base()
Constructor.
Definition intrusive_queue.h:191
size_t size() const
Returns the number of elements.
Definition intrusive_queue.h:181
Definition intrusive_queue.h:220
Definition intrusive_queue.h:92
bitset_ext
Definition absolute.h:39