2001-07-07 19:16:38 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/stack.h
|
|
|
|
// Purpose: STL stack clone
|
|
|
|
// Author: Lindsay Mathieson
|
|
|
|
// Modified by:
|
|
|
|
// Created: 30.07.2001
|
|
|
|
// Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-07-07 19:16:38 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_STACK_H_
|
|
|
|
#define _WX_STACK_H_
|
|
|
|
|
|
|
|
#include "wx/vector.h"
|
|
|
|
|
2007-09-02 23:05:50 -04:00
|
|
|
#define WX_DECLARE_STACK(obj, cls) \
|
|
|
|
class cls : public wxVector<obj> \
|
2001-07-07 19:16:38 -04:00
|
|
|
{\
|
|
|
|
public:\
|
2004-09-22 10:38:52 -04:00
|
|
|
void push(const obj& o)\
|
|
|
|
{\
|
2007-09-02 23:05:50 -04:00
|
|
|
push_back(o); \
|
2004-09-22 10:38:52 -04:00
|
|
|
};\
|
2001-07-07 19:16:38 -04:00
|
|
|
\
|
2004-09-22 10:38:52 -04:00
|
|
|
void pop()\
|
|
|
|
{\
|
2007-09-02 23:05:50 -04:00
|
|
|
pop_back(); \
|
2004-09-22 10:38:52 -04:00
|
|
|
};\
|
2001-07-07 19:16:38 -04:00
|
|
|
\
|
2004-09-22 10:38:52 -04:00
|
|
|
obj& top()\
|
|
|
|
{\
|
2007-09-02 23:05:50 -04:00
|
|
|
return at(size() - 1);\
|
2004-09-22 10:38:52 -04:00
|
|
|
};\
|
|
|
|
const obj& top() const\
|
|
|
|
{\
|
2007-09-02 23:05:50 -04:00
|
|
|
return at(size() - 1); \
|
2004-09-22 10:38:52 -04:00
|
|
|
};\
|
2001-07-07 19:16:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _WX_STACK_H_
|
|
|
|
|