Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

intrusive_stack_base< TLink > Class Template Reference

intrusive_stack_base< TLink > Class Template Reference
[stack]

Base for intrusive stack. More...

#include <intrusive_stack.h>

Inherited by intrusive_stack< TValue, TLink >.

Public Member Functions

void push (link_type &value)
 Adds a value to the stack.
void pop ()
 Removes the oldest item from the top of the stack.
template<typename TContainer >
void pop_into (TContainer &destination)
 Removes the oldest item from the queue and pushes it to the destination.
void reverse ()
 Reverses the stack order.
void clear ()
 Clears the stack to the empty state.
bool empty () const
 Checks if the stack is in the empty state.
size_t size () const
 Returns the number of elements.

Protected Member Functions

 intrusive_stack_base ()
 Constructor.

Protected Attributes

link_type * p_top
 The current top of the stack.
size_t current_size
 Counts the number of elements in the list.

Detailed Description

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

Base for intrusive stack.

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_stack.h.


Constructor & Destructor Documentation

intrusive_stack_base (  ) [protected]

Constructor.

Definition at line 185 of file intrusive_stack.h.


Member Function Documentation

void clear (  )

Clears the stack to the empty state.

Definition at line 154 of file intrusive_stack.h.

bool empty (  ) const

Checks if the stack is in the empty state.

Definition at line 167 of file intrusive_stack.h.

void pop (  )

Removes the oldest item from the top of the stack.

Undefined behaviour if the stack is already empty.

Definition at line 108 of file intrusive_stack.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 124 of file intrusive_stack.h.

void push ( link_type &  value )

Adds a value to the stack.

Parameters:
valueThe value to push to the stack.

Definition at line 90 of file intrusive_stack.h.

void reverse (  )

Reverses the stack order.

Definition at line 134 of file intrusive_stack.h.

size_t size (  ) const

Returns the number of elements.

Definition at line 175 of file intrusive_stack.h.


Field Documentation

size_t current_size [protected]

Counts the number of elements in the list.

Definition at line 193 of file intrusive_stack.h.

link_type* p_top [protected]

The current top of the stack.

Definition at line 191 of file intrusive_stack.h.