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

Standard stack abstraction (Push, Pop, Top). More...

#include <stack.hpp>

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

Public Member Functions

virtual bool Push (const Type &element)=0
 Push a new element at the top of stack. More...
 
virtual bool Pop ()=0
 Pop (remove/deduce) an element from the top. More...
 
virtual Type Top () const =0
 Access the top element of stack. More...
 
virtual SzType Size () const =0
 number of elements contained in 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::AStack< Type, SzType >

Standard stack abstraction (Push, Pop, Top).

Definition at line 39 of file stack.hpp.

Member Function Documentation

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

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 = int>
bool scire::AStack< Type, SzType >::Deduce ( )
inlinevirtual

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
inlinevirtual

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 = int>
virtual bool scire::AStack< Type, SzType >::Pop ( )
pure virtual

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

Returns
true on success

Implemented in scire::StackCrate< Type, SzType >, and scire::Stack< Type, SzType >.

template<typename Type , typename SzType = int>
virtual bool scire::AStack< Type, SzType >::Push ( const Type &  element)
pure virtual

Push a new element at the top of stack.

Parameters
elementelement to push
Returns
true on success

Implemented in scire::StackCrate< Type, SzType >, and scire::Stack< Type, SzType >.

template<typename Type , typename SzType = int>
virtual SzType scire::AStack< Type, SzType >::Size ( ) const
pure virtual

number of elements contained in

Returns
current size

Implements scire::AContainer< Type, SzType >.

Implemented in scire::StackCrate< Type, SzType >, and scire::Stack< Type, SzType >.

template<typename Type , typename SzType = int>
virtual Type scire::AStack< Type, SzType >::Top ( ) const
pure virtual

Access the top element of stack.

Returns
element at the top of the stack

Implemented in scire::StackCrate< Type, SzType >, and scire::Stack< Type, SzType >.


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