]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stack.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: STL stack clone
4 // Author: Lindsay Mathieson
7 // Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org>
8 // Licence: wxWindows 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 if ( !Alloc(size() + 1) )\
25 wxFAIL_MSG(_T("failed to extend stack"));\
32 RemoveAt(size() - 1);\
37 return *(obj *) GetItem(size() - 1);\
39 const obj& top() const\
41 return *(obj *) GetItem(size() - 1);\
45 #endif // _WX_STACK_H_