Change directory structure
This commit is contained in:
42
luprex/cpp/core/luasnap.hpp
Normal file
42
luprex/cpp/core/luasnap.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LUASNAP
|
||||
//
|
||||
// A lua interpreter that can be checkpointed (snapshotted). This makes it
|
||||
// possible to roll the entire interpreter back to a previously-snapshotted
|
||||
// state.
|
||||
//
|
||||
// To accomplish this, we use eris serialization. This is messy and not
|
||||
// very modular, but it does work.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LUASNAP_HPP
|
||||
#define LUASNAP_HPP
|
||||
|
||||
#include "streambuffer.hpp"
|
||||
#include "luastack.hpp"
|
||||
|
||||
class LuaSnap : public eng::nevernew {
|
||||
private:
|
||||
lua_State *state_;
|
||||
|
||||
public:
|
||||
LuaSnap();
|
||||
~LuaSnap();
|
||||
|
||||
// Get the lua intepreter.
|
||||
//
|
||||
lua_State *state() const { return state_; }
|
||||
|
||||
// Serialize the state of the lua interpreter.
|
||||
//
|
||||
void serialize(StreamBuffer *sb);
|
||||
|
||||
// Restore the the lua interpreter given a serialized state.
|
||||
//
|
||||
void deserialize(StreamBuffer *sb);
|
||||
};
|
||||
|
||||
|
||||
#endif // LUASNAP_HPP
|
||||
Reference in New Issue
Block a user