scire
Sadh's C++ Impromptu Routines Ensemble
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
scire::StackCrate< Type, SzType > Class Template Reference

array implementation of stack More...

#include <stack.hpp>

Inheritance diagram for scire::StackCrate< Type, SzType >:
scire::AStack< Type, SzType > scire::ICrate< Type, SzType > scire::AContainer< Type, SzType >

Public Member Functions

 StackCrate (SzType stackCapacity)
 initialize a StackCrate object and allocate array crate More...
 
 ~StackCrate ()
 finalize a StackCrate object by deleting array crate More...
 
SzType Capacity () const
 
SzType Size () const
 number of elements contained in More...
 
bool Push (const Type &element)
 Push a new element at the top of stack. More...
 
bool Pop ()
 Pop (remove/deduce) an element from the top. More...
 
Type Top () const
 Access the top element of stack. More...
 
bool Add (const Type &element)
 add an element More...
 
bool Deduce ()
 deduce one element More...
 
Type Peek () const
 peek into next element contained in More...
 
virtual bool IsEmpty () const
 check if empty More...
 

Detailed Description

template<typename Type, typename SzType = int>
class scire::StackCrate< Type, SzType >

array implementation of stack

Definition at line 206 of file stack.hpp.

Constructor & Destructor Documentation

template<typename Type , typename SzType >
scire::StackCrate< Type, SzType >::StackCrate ( SzType  stackCapacity)

initialize a StackCrate object and allocate array crate

Definition at line 246 of file stack.hpp.

template<typename Type , typename SzType >
scire::StackCrate< Type, SzType >::~StackCrate ( )

finalize a StackCrate object by deleting array crate

Definition at line 255 of file stack.hpp.

Member Function Documentation

template<typename Type , typename SzType = int>
bool scire::AStack< Type, SzType >::Add ( const Type &  element)
inlinevirtualinherited

add an element

Parameters
elementelement to be added as new element
Returns
true on success

Implements scire::AContainer< Type, SzType >.

Definition at line 70 of file stack.hpp.

template<typename Type , typename SzType >
SzType scire::StackCrate< Type, SzType >::Capacity ( ) const
virtual

Implements scire::ICrate< Type, SzType >.

Definition at line 267 of file stack.hpp.

template<typename Type , typename SzType = int>
bool scire::AStack< Type, SzType >::Deduce ( )
inlinevirtualinherited

deduce one element

Returns
true on success

Implements scire::AContainer< Type, SzType >.

Definition at line 76 of file stack.hpp.

template<typename Type , typename SzType = int>
virtual bool scire::AContainer< Type, SzType >::IsEmpty ( ) const
inlinevirtualinherited

check if empty

Returns
true when empty

Definition at line 75 of file container.hpp.

template<typename Type , typename SzType = int>
Type scire::AStack< Type, SzType >::Peek ( ) const
inlinevirtualinherited

peek into next element contained in

Returns
element

Implements scire::AContainer< Type, SzType >.

Definition at line 82 of file stack.hpp.

template<typename Type , typename SzType >
bool scire::StackCrate< Type, SzType >::Pop ( )
virtual

Pop (remove/deduce) an element from the top.

Returns
true on success

Implements scire::AStack< Type, SzType >.

Definition at line 286 of file stack.hpp.

template<typename Type , typename SzType >
bool scire::StackCrate< Type, SzType >::Push ( const Type &  element)
virtual

Push a new element at the top of stack.

Parameters
elementelement to push
Returns
true on success

Implements scire::AStack< Type, SzType >.

Definition at line 273 of file stack.hpp.

template<typename Type , typename SzType >
SzType scire::StackCrate< Type, SzType >::Size ( ) const
virtual

number of elements contained in

Returns
current size

Implements scire::AStack< Type, SzType >.

Definition at line 261 of file stack.hpp.

template<typename Type , typename SzType >
Type scire::StackCrate< Type, SzType >::Top ( ) const
virtual

Access the top element of stack.

Returns
element at the top of the stack

Implements scire::AStack< Type, SzType >.

Definition at line 296 of file stack.hpp.


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