31 #ifndef ETL_INTRUSIVE_STACK_INCLUDED
32 #define ETL_INTRUSIVE_STACK_INCLUDED
55 :
exception(reason_, file_name_, line_number_)
79 template <
typename TLink>
85 typedef TLink link_type;
91 void push(link_type& value)
95 if (
p_top != ETL_NULLPTR)
97 etl::link(value,
p_top);
111 #if defined(ETL_CHECK_PUSH_POP)
114 link_type* p_next =
p_top->etl_next;
124 template <
typename TContainer>
127 link_type* p_link =
p_top;
129 destination.push(*p_link);
137 link_type* previous = ETL_NULLPTR;
138 link_type* current =
p_top;
141 while (current != ETL_NULLPTR)
143 next = current->etl_next;
144 current->etl_next = previous;
187 :
p_top(ETL_NULLPTR),
211 template <
typename TValue,
typename TLink>
217 typedef typename etl::intrusive_stack_base<TLink>::link_type link_type;
220 typedef TValue value_type;
221 typedef value_type* pointer;
222 typedef const value_type* const_pointer;
223 typedef value_type& reference;
224 typedef const value_type& const_reference;
225 typedef size_t size_type;
242 return *
static_cast<TValue*
>(this->
p_top);
249 const_reference
top()
const
251 return *
static_cast<const TValue*
>(this->
p_top);
Definition: intrusive_stack.h:65
Definition: intrusive_stack.h:51
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
exception(string_type reason_, string_type file_, numeric_type line_)
Constructor.
Definition: exception.h:67
Definition: exception.h:47
void pop()
Definition: intrusive_stack.h:109
size_t size() const
Returns the number of elements.
Definition: intrusive_stack.h:176
reference top()
Definition: intrusive_stack.h:240
void reverse()
Reverses the stack order.
Definition: intrusive_stack.h:135
void clear()
Clears the stack to the empty state.
Definition: intrusive_stack.h:155
const_reference top() const
Definition: intrusive_stack.h:249
~intrusive_stack_base()
Destructor.
Definition: intrusive_stack.h:195
void pop_into(TContainer &destination)
Definition: intrusive_stack.h:125
intrusive_stack()
Constructor.
Definition: intrusive_stack.h:230
size_t current_size
Counts the number of elements in the list.
Definition: intrusive_stack.h:201
bool empty() const
Checks if the stack is in the empty state.
Definition: intrusive_stack.h:168
link_type * p_top
The current top of the stack.
Definition: intrusive_stack.h:199
void push(link_type &value)
Definition: intrusive_stack.h:91
intrusive_stack_base()
Constructor.
Definition: intrusive_stack.h:186
Definition: intrusive_stack.h:213
Definition: intrusive_stack.h:81
Definition: absolute.h:37