Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Stacks - BaseStackC<class T>
 

  PUBLIC
BaseStackC::BaseStackC(void)
BaseStackC::BaseStackC(const BaseStackC &)
BaseStackC::Top(void)
BaseStackC::Top(void) const
BaseStackC::First(void)
BaseStackC::First(void) const
BaseStackC::IsEmpty(void) const
BaseStackC::Size(void) const
BaseStackC::DbPrint(void)
BaseStackC::operator =(const BaseStackC &)
BaseStackC::AllocBlk(void) const

   BaseStackC<class T>   
 
Base stack.
 
include "Ravl/Stack.hh"
Created:05/10/1995 
Source file:Ravl/Core/Container/Misc/Stack.hh
User Level:Develop
Library:RavlCore
Example:exStack.cc
In Scope:RavlN

Comments:
Complexity proportional to sqrt(N); not N!

Parent Classes: Derived Classes: Child Classes:
s_Blk
Variables:
int blkSize;
size of the first (top) block in the stack

s_Blk * topBlk;
pointer to the first (top) block

int top;
index of the first *empty* slot in the last block this choice reduces the number of if statements; as 'top' can't point to the top of the stack (first occupied elem.) if the stack is empty

Methods:
BaseStackC()
Default constructor
create an empty stack.

BaseStackC(const BaseStackC<T> &)
Copy constructor.

T & Top()
Access element at the top of the stack.
i.e. the next one returned if Pop() is called.

const T & Top() const
Access element at the top of the stack.
i.e. the next one returned if Pop() is called.

T & First()
Access element at the top of the stack.
i.e. the next one returned if Pop() is called. Same as Top().

const T & First() const
Access element at the top of the stack.
i.e. the next one returned if Pop() is called. Same as Top().

bool IsEmpty() const
Test if stack is empty.
Returns true if it is empty.

long Size() const
Get the number of elements in the stack.

void DbPrint()
Usefull for debuging the stack
Not usefull for normal users.

BaseStackC<T> & operator =(const BaseStackC<T> &)
--------- private function for memory allocation place at the top of the file to allow inlining

s_Blk * AllocBlk() const


Maintainer:George (Jiri) Matas, Created: 05/10/1995, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002