Add Packer/Unpacker, add serialization to LuaSnap
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#ifndef LUASNAP_HPP
|
||||
#define LUASNAP_HPP
|
||||
|
||||
#include "packer.hpp"
|
||||
#include "luastack.hpp"
|
||||
|
||||
class LuaSnap {
|
||||
@@ -29,6 +30,14 @@ public:
|
||||
//
|
||||
lua_State *state() const { return state_; }
|
||||
|
||||
// Serialize the state of the lua interpreter.
|
||||
//
|
||||
void serialize(Packer *pk);
|
||||
|
||||
// Restore the the lua interpreter given a serialized state.
|
||||
//
|
||||
void deserialize(Unpacker *unpk);
|
||||
|
||||
// Return true if there's a saved snapshot.
|
||||
//
|
||||
bool have_snapshot() const;
|
||||
@@ -44,6 +53,7 @@ public:
|
||||
// If there is no snapshot, this panics.
|
||||
//
|
||||
void rollback();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user