scire
Sadh's C++ Impromptu Routines Ensemble
|
Container Inferface. More...
#include <container.hpp>
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... | |
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.
|
inlinevirtual |
virtual dtor for containers
Definition at line 44 of file container.hpp.
|
pure virtual |
add an element
element | element to be added as new element |
Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.
|
pure virtual |
deduce one element
Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.
|
inlinevirtual |
|
pure virtual |
peek into next element contained in
Implemented in scire::AQueue< Type, SzType >, scire::SinglyList< Type, SzType >, and scire::AStack< Type, SzType >.
|
pure virtual |
number of elements contained in
Implemented in scire::QueueCrate< Type, SzType >, scire::StackCrate< Type, SzType >, scire::Queue< Type, SzType >, scire::Stack< Type, SzType >, scire::SinglyList< Type, SzType >, scire::AStack< Type, SzType >, and scire::AQueue< Type, SzType >.