]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stack.h
3edda4fc49b9be6b77558531a2bb1f07c1d44a47
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: STL stack clone
4 // Author: Lindsay Mathieson
7 // Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org>
8 // Licence: wxWidgets licence
9 ///////////////////////////////////////////////////////////////////////////////
14 #include "wx/vector.h"
16 #define WX_DECLARE_STACK(obj, cls)\
17 class cls : public wxVectorBase\
19 WX_DECLARE_VECTORBASE(obj, cls);\
21 void push(const obj& o)\
23 bool rc = Alloc(size() + 1);\
30 RemoveAt(size() - 1);\
35 return *(obj *) GetItem(size() - 1);\
37 const obj& top() const\
39 return *(obj *) GetItem(size() - 1);\
43 #endif // _WX_STACK_H_