Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

stack_base Class Reference

A fixed capacity stack written in the STL style. More...

#include <stack.h>

Inherited by istack< T >.

Public Types

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

Public Member Functions

bool empty () const
 Checks to see if the stack is empty.
bool full () const
 Checks to see if the stack is full.
size_type size () const
 Returns the current number of items top the stack.
size_type max_size () const
 Returns the maximum number of items that can be stacked.
size_t available () const
 Returns the remaining capacity.

Protected Member Functions

 stack_base (size_type max_size_)
 The constructor that is called from derived classes.
void add_in ()
 Increments the indexes value to record a stack addition.
void del_out ()
 Decrements the indexes value to record a queue deletion.

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 CAPACITY
 The maximum number of items in the stack.
etl::debug_count construct_count
 For internal debugging purposes.

Detailed Description

A fixed capacity stack written in the STL style.

This stack cannot be used for concurrent access from multiple threads.

Definition at line 106 of file stack.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of stack.

Reimplemented in istack< T >.

Definition at line 110 of file stack.h.


Constructor & Destructor Documentation

stack_base ( size_type  max_size_ ) [protected]

The constructor that is called from derived classes.

Definition at line 160 of file stack.h.


Member Function Documentation

void add_in (  ) [protected]

Increments the indexes value to record a stack addition.

Definition at line 170 of file stack.h.

size_t available (  ) const

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 150 of file stack.h.

void del_out (  ) [protected]

Decrements the indexes value to record a queue deletion.

Definition at line 179 of file stack.h.

bool empty (  ) const

Checks to see if the stack is empty.

Returns:
true if the stack is empty, otherwise false

Definition at line 116 of file stack.h.

bool full (  ) const

Checks to see if the stack is full.

Returns:
true if the stack is full, otherwise false

Definition at line 125 of file stack.h.

size_type max_size (  ) const

Returns the maximum number of items that can be stacked.

Definition at line 141 of file stack.h.

size_type size (  ) const

Returns the current number of items top the stack.

Definition at line 133 of file stack.h.


Field Documentation

const size_type CAPACITY [protected]

The maximum number of items in the stack.

Definition at line 188 of file stack.h.

For internal debugging purposes.

Definition at line 189 of file stack.h.

size_type current_size [protected]

The number of items in the stack.

Definition at line 187 of file stack.h.

size_type top_index [protected]

The index of the top of the stack.

Definition at line 186 of file stack.h.