|
Last change
on this file since 8226 was
8061,
checked in by bensch, 19 years ago
|
|
merged the scriptengine back to the trunk
|
|
File size:
588 bytes
|
| Line | |
|---|
| 1 | #ifndef __RESTORE_STACK_H__ |
|---|
| 2 | #define __RESTORE_STACK_H__ |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | #include "VirtualMachine.h" |
|---|
| 6 | /// Forward declaration |
|---|
| 7 | struct lua_State; |
|---|
| 8 | |
|---|
| 9 | namespace OrxScript |
|---|
| 10 | { |
|---|
| 11 | |
|---|
| 12 | //! Class to restore the stack to the way we found it. |
|---|
| 13 | class LuaRestoreStack |
|---|
| 14 | { |
|---|
| 15 | public: |
|---|
| 16 | /** |
|---|
| 17 | * @brief Stores the stack and the index to the top element |
|---|
| 18 | * |
|---|
| 19 | * @param virtualMachine the virtual machine to save |
|---|
| 20 | */ |
|---|
| 21 | LuaRestoreStack (LuaVirtualMachine& virtualMachine); |
|---|
| 22 | virtual ~LuaRestoreStack (void); |
|---|
| 23 | |
|---|
| 24 | protected: |
|---|
| 25 | lua_State* savedState; |
|---|
| 26 | int savedTopIndex; |
|---|
| 27 | }; |
|---|
| 28 | |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | #endif // __RESTORE_STACK_H__ |
|---|
Note: See
TracBrowser
for help on using the repository browser.