1994-08-12 10:52:49 +00:00
|
|
|
#ifndef __STACK_H
|
|
|
|
#define __STACK_H
|
|
|
|
|
|
|
|
#ifndef __ARRAY_H
|
|
|
|
#include <array.h>
|
|
|
|
#endif
|
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @doc EXTERNAL
|
1994-08-12 10:52:49 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @class TStack | Classe per la gestione dello stack a basso livello
|
|
|
|
//
|
|
|
|
// @base public | TArray
|
1994-08-12 10:52:49 +00:00
|
|
|
class TStack : private TArray
|
1996-01-31 17:19:02 +00:00
|
|
|
|
|
|
|
// @author:(INTERNAL) ???
|
|
|
|
|
|
|
|
// @access Private Member
|
1994-08-12 10:52:49 +00:00
|
|
|
{
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Puntatore alla cima dello stack
|
|
|
|
int _sp;
|
1994-08-12 10:52:49 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @access Public Member
|
1994-08-12 10:52:49 +00:00
|
|
|
public:
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Costruttore. Chaima il costruttore di <c TArray>
|
|
|
|
TStack(int size);
|
1994-08-12 10:52:49 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna il puntatore allo stack
|
|
|
|
int count() const
|
|
|
|
{ return _sp; }
|
|
|
|
// @cmember Aggiunge un oggetto sullo stack
|
|
|
|
void push(const TObject&);
|
|
|
|
// @cmember Ritorna il primo oggetto sulla cima dello stack
|
|
|
|
TObject& pop();
|
1994-08-12 10:52:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|