2001-07-07 23:16:38 +00: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 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-07-07 23:16:38 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_STACK_H_
|
|
|
|
#define _WX_STACK_H_
|
|
|
|
|
|
|
|
#include "wx/vector.h"
|
|
|
|
|
2007-09-03 03:05:50 +00:00
|
|
|
#define WX_DECLARE_STACK(obj, cls) \
|
|
|
|
class cls : public wxVector<obj> \
|
2001-07-07 23:16:38 +00:00
|
|
|
{\
|
|
|
|
public:\
|
2004-09-22 14:38:52 +00:00
|
|
|
void push(const obj& o)\
|
|
|
|
{\
|
2007-09-03 03:05:50 +00:00
|
|
|
push_back(o); \
|
2004-09-22 14:38:52 +00:00
|
|
|
};\
|
2001-07-07 23:16:38 +00:00
|
|
|
\
|
2004-09-22 14:38:52 +00:00
|
|
|
void pop()\
|
|
|
|
{\
|
2007-09-03 03:05:50 +00:00
|
|
|
pop_back(); \
|
2004-09-22 14:38:52 +00:00
|
|
|
};\
|
2001-07-07 23:16:38 +00:00
|
|
|
\
|
2004-09-22 14:38:52 +00:00
|
|
|
obj& top()\
|
|
|
|
{\
|
2007-09-03 03:05:50 +00:00
|
|
|
return at(size() - 1);\
|
2004-09-22 14:38:52 +00:00
|
|
|
};\
|
|
|
|
const obj& top() const\
|
|
|
|
{\
|
2007-09-03 03:05:50 +00:00
|
|
|
return at(size() - 1); \
|
2004-09-22 14:38:52 +00:00
|
|
|
};\
|
2001-07-07 23:16:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _WX_STACK_H_
|
|
|
|
|