Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::istack< T > Class Template Reference

This is the base for all stacks that contain a particular type. More...

#include <istack.h>

Public Types

typedef T value_type
 The type stored in the stack.
 
typedef T & reference
 A reference to the type used in the stack.
 
typedef const T & const_reference
 A const reference to the type used in the stack.
 
typedef T * pointer
 A pointer to the type used in the stack.
 
typedef const T * const_pointer
 A const pointer to the type used in the stack.
 
typedef stack_base::size_type size_type
 The type used for determining the size of the stack.
 
- Public Types inherited from etl::stack_base
typedef size_t size_type
 The type used for determining the size of stack.
 

Public Member Functions

reference top ()
 
void push (parameter_t item)
 
reference push ()
 
const_reference top () const
 
- Public Member Functions inherited from etl::stack_base
bool empty () const
 
bool full () const
 
size_type size () const
 Returns the current number of items top the stack.
 
size_type capacity () const
 Returns the maximum number of items that can be stacked.
 
size_type max_size () const
 Returns the maximum number of items that can be stacked.
 
size_t available () const
 
void clear ()
 Clears the stack to the empty state.
 
void pop ()
 

Protected Member Functions

 istack (T *buffer, size_type max_size)
 The constructor that is called from derived classes.
 
- Protected Member Functions inherited from etl::stack_base
 stack_base (size_type max_size)
 The constructor that is called from derived classes.
 

Additional Inherited Members

- Protected Attributes inherited from etl::stack_base
size_type top_index
 The index of the top of the stack.
 
size_type current_size
 The number of items in the stack.
 
const size_type MAX_SIZE
 The maximum number of items in the stack.
 

Detailed Description

template<typename T>
class etl::istack< T >

This is the base for all stacks that contain a particular type.

Normally a reference to this type will be taken from a derived stack.

etl::istack<int>& iQueue = myQueue;
Warning
This stack cannot be used for concurrent access from multiple threads.
Template Parameters
TThe type of item that the stack holds.

Member Function Documentation

template<typename T>
void etl::istack< T >::push ( parameter_t  item)
inline

Adds an item to the stack. If ETL_THROW_EXCEPTIONS is defined, throws an etl::stack_full is the stack is already full, otherwise does nothing if full.

Parameters
itemThe item to push to the stack.
template<typename T>
reference etl::istack< T >::push ( )
inline

Allows a possibly more efficient 'push' by moving to the next input item and returning a reference to it. This may eliminate a copy by allowing direct construction in-place.
If ETL_THROW_EXCEPTIONS is defined, throws an etl::stack_full is the stack is already full, otherwise does nothing if full.

Returns
A reference to the position to 'push' to.
template<typename T>
reference etl::istack< T >::top ( )
inline

Gets a reference to the item at the top of the stack.

Returns
A reference to the item at the top of the stack.
template<typename T>
const_reference etl::istack< T >::top ( ) const
inline

Gets a const reference to the item at the top of the stack.

Returns
A const reference to the item at the top of the stack.

The documentation for this class was generated from the following file: