]> git.saurik.com Git - wxWidgets.git/blame - include/wx/stack.h
Fixed HTML list output
[wxWidgets.git] / include / wx / stack.h
CommitLineData
3c648a82
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/stack.h
3// Purpose: STL stack clone
4// Author: Lindsay Mathieson
5// Modified by:
6// Created: 30.07.2001
7// Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org>
65571936 8// Licence: wxWindows licence
3c648a82
VZ
9///////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_STACK_H_
12#define _WX_STACK_H_
13
14#include "wx/vector.h"
15
c21ee792
RD
16#define WX_DECLARE_STACK(obj, cls) \
17class cls : public wxVector<obj> \
3c648a82 18{\
3c648a82 19public:\
d775fa82
WS
20 void push(const obj& o)\
21 {\
c21ee792 22 push_back(o); \
d775fa82 23 };\
3c648a82 24\
d775fa82
WS
25 void pop()\
26 {\
c21ee792 27 pop_back(); \
d775fa82 28 };\
3c648a82 29\
d775fa82
WS
30 obj& top()\
31 {\
c21ee792 32 return at(size() - 1);\
d775fa82
WS
33 };\
34 const obj& top() const\
35 {\
c21ee792 36 return at(size() - 1); \
d775fa82 37 };\
3c648a82
VZ
38}
39
40#endif // _WX_STACK_H_
41