c21ee7925b
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
42 lines
840 B
C++
42 lines
840 B
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// 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>
|
|
// Licence: wxWindows licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_STACK_H_
|
|
#define _WX_STACK_H_
|
|
|
|
#include "wx/vector.h"
|
|
|
|
#define WX_DECLARE_STACK(obj, cls) \
|
|
class cls : public wxVector<obj> \
|
|
{\
|
|
public:\
|
|
void push(const obj& o)\
|
|
{\
|
|
push_back(o); \
|
|
};\
|
|
\
|
|
void pop()\
|
|
{\
|
|
pop_back(); \
|
|
};\
|
|
\
|
|
obj& top()\
|
|
{\
|
|
return at(size() - 1);\
|
|
};\
|
|
const obj& top() const\
|
|
{\
|
|
return at(size() - 1); \
|
|
};\
|
|
}
|
|
|
|
#endif // _WX_STACK_H_
|
|
|