Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::stack_base Class Reference

#include <stack_base.h>

Public Types

typedef size_t size_type
 The type used for determining the size of stack.
 

Public Member Functions

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

 stack_base (size_type max_size)
 The constructor that is called from derived classes.
 

Protected Attributes

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

A fixed capacity stack written in the STL style. This stack cannot be used for concurrent access from multiple threads.

Member Function Documentation

size_t etl::stack_base::available ( ) const
inline

Returns the remaining capacity.

Returns
The remaining capacity.
bool etl::stack_base::empty ( ) const
inline

Checks to see if the stack is empty.

Returns
true if the stack is empty, otherwise false
bool etl::stack_base::full ( ) const
inline

Checks to see if the stack is full.

Returns
true if the stack is full, otherwise false
void etl::stack_base::pop ( )
inline

Removes the oldest item from the top of the stack. Does nothing if the stack is already empty.


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