|
// File : Stack.h
// Author: Hans Hamm alias Sendel
// Date : 24.04.2003
// What : Pointer Stack Class
//////////////////////////////////////////////////////////////////////
#ifndef __STACK_H__
#define __STACK_H__
#ifndef SAVEDELETE
#define SAVEDELETE(x) { \
if (x != NULL) \
{ \
delete x; \
x = NULL; \
} \
}
#endif
class Stack
{
protected:
struct node_t
{
void * item;
node_t * next;
};
int m_Count;
node_t * m_Head;
node_t * m_Current;
Stack * m_pStack_Settings;
public:
void push(void * pItemToPush);
void * pop();
void * pop(void * pItemToPop);
void * getFirst();
void * getNext();
void pushSettings();
void popSettings();
void clear();
int getSize();
void * operator[](int i);
Stack();
virtual ~Stack();
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.