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

Container Inferface. More...

#include <container.hpp>

Inheritance diagram for scire::AContainer< Type, SzType >:
scire::AQueue< Type, SzType > scire::AStack< Type, SzType > scire::SinglyList< Type, SzType > scire::Queue< Type, SzType > scire::QueueCrate< Type, SzType > scire::Stack< Type, SzType > scire::StackCrate< Type, SzType >

Public Member Functions

virtual ~AContainer ()
 virtual dtor for containers More...
 
virtual SzType Size () const =0
 number of elements contained in More...
 
virtual bool Add (const Type &element)=0
 add an element More...
 
virtual bool Deduce ()=0
 deduce one element More...
 
virtual Type Peek () const =0
 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::AContainer< Type, SzType >

Container Inferface.

Size() function is necessary to all containers; Each container shall also implement Add(), Deduce() and Peek() function eventually allowing programs to switch between completely different containers (e.g. List, Queue, Stack etc. even when Add/Deduce/Peek bear very different concepts; e.g. Add vs. Insert vs Enque vs Push).

Definition at line 40 of file container.hpp.

Constructor & Destructor Documentation

template<typename Type , typename SzType = int>
virtual scire::AContainer< Type, SzType >::~AContainer ( )
inlinevirtual

virtual dtor for containers

Definition at line 44 of file container.hpp.

Member Function Documentation

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

add an element

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

Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.

template<typename Type , typename SzType = int>
virtual bool scire::AContainer< Type, SzType >::Deduce ( )
pure virtual

deduce one element

Returns
true on success

Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.

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

check if empty

Returns
true when empty

Definition at line 75 of file container.hpp.

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

peek into next element contained in

Returns
element

Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.

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

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