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_)
91 template <
typename TLink>
97 typedef TLink link_type;
113 p_back->etl_next = &value;
132 link_type* p_next = p_front->etl_next;
151 template <
typename TContainer>
156 destination.push(*p_link);
220 template <
typename TValue,
typename TLink>
229 typedef TValue value_type;
230 typedef value_type* pointer;
231 typedef const value_type* const_pointer;
232 typedef value_type& reference;
233 typedef const value_type& const_reference;
234 typedef size_t size_type;
253 return *
static_cast<TValue*
>(this->
terminator.etl_next);
265 return *
static_cast<TValue*
>(this->
p_back);
277 return *
static_cast<const TValue*
>(this->
terminator.etl_next);
289 return *
static_cast<const TValue*
>(this->
p_back);
Definition intrusive_queue.h:62
Definition intrusive_queue.h:76
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
Definition exception.h:59
void pop_into(TContainer &destination)
Definition intrusive_queue.h:152
const_reference front() const
Definition intrusive_queue.h:274
const_reference back() const
Definition intrusive_queue.h:286
reference back()
Definition intrusive_queue.h:262
size_t current_size
Counts the number of elements in the list.
Definition intrusive_queue.h:209
void pop()
Definition intrusive_queue.h:126
link_type terminator
Definition intrusive_queue.h:206
bool empty() const
Checks if the queue is in the empty state.
Definition intrusive_queue.h:175
intrusive_queue()
Constructor.
Definition intrusive_queue.h:239
~intrusive_queue_base()
Destructor.
Definition intrusive_queue.h:203
void push(link_type &value)
Definition intrusive_queue.h:103
reference front()
Definition intrusive_queue.h:250
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:162
intrusive_queue_base()
Constructor.
Definition intrusive_queue.h:193
size_t size() const
Returns the number of elements.
Definition intrusive_queue.h:183
Definition intrusive_queue.h:222
Definition intrusive_queue.h:93
bitset_ext
Definition absolute.h:40