31#ifndef ETL_INTRUSIVE_STACK_INCLUDED
32#define ETL_INTRUSIVE_STACK_INCLUDED
52 :
exception(reason_, file_name_, line_number_)
66 :
intrusive_stack_exception(ETL_ERROR_TEXT(
"intrusive_stack:empty", ETL_INTRUSIVE_STACK_FILE_ID
"A"), file_name_, line_number_)
80 :
intrusive_stack_exception(ETL_ERROR_TEXT(
"intrusive_stack:value is already linked", ETL_INTRUSIVE_STACK_FILE_ID
"B"), file_name_, line_number_)
90 template <
typename TLink>
96 typedef TLink link_type;
106 value.etl_next =
p_top;
118#if defined(ETL_CHECK_PUSH_POP)
121 link_type* p_next =
p_top->etl_next;
132 template <
typename TContainer>
135 link_type* p_link =
p_top;
137 destination.push(*p_link);
146 link_type* current =
p_top;
151 next = current->etl_next;
152 current->etl_next = previous;
220 template <
typename TValue,
typename TLink>
226 typedef typename etl::intrusive_stack_base<TLink>::link_type link_type;
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;
251 return *
static_cast<TValue*
>(this->
p_top);
258 const_reference
top()
const
260 return *
static_cast<const TValue*
>(this->
p_top);
Definition: intrusive_stack.h:62
Definition: intrusive_stack.h:48
Definition: intrusive_stack.h:76
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition: exception.h:69
Definition: exception.h:47
void pop()
Definition: intrusive_stack.h:116
size_t size() const
Returns the number of elements.
Definition: intrusive_stack.h:184
reference top()
Definition: intrusive_stack.h:249
void reverse()
Reverses the stack order.
Definition: intrusive_stack.h:143
void clear()
Clears the stack to the empty state.
Definition: intrusive_stack.h:163
const_reference top() const
Definition: intrusive_stack.h:258
~intrusive_stack_base()
Destructor.
Definition: intrusive_stack.h:203
void pop_into(TContainer &destination)
Definition: intrusive_stack.h:133
intrusive_stack()
Constructor.
Definition: intrusive_stack.h:239
size_t current_size
Counts the number of elements in the list.
Definition: intrusive_stack.h:210
bool empty() const
Checks if the stack is in the empty state.
Definition: intrusive_stack.h:176
link_type * p_top
The current top of the stack.
Definition: intrusive_stack.h:207
link_type terminator
Terminator link of the queue.
Definition: intrusive_stack.h:208
void push(link_type &value)
Definition: intrusive_stack.h:102
intrusive_stack_base()
Constructor.
Definition: intrusive_stack.h:194
Definition: intrusive_stack.h:222
Definition: intrusive_stack.h:92
bitset_ext
Definition: absolute.h:38