Implemented class StreamBuffer, which I'm quite satisfied with.

This commit is contained in:
2021-03-05 14:20:21 -05:00
parent 9d86347d54
commit c742bc5645
9 changed files with 776 additions and 215 deletions

View File

@@ -14,13 +14,13 @@
#ifndef LUASNAP_HPP
#define LUASNAP_HPP
#include "packer.hpp"
#include "StreamBuffer.hpp"
#include "luastack.hpp"
class LuaSnap {
private:
lua_State *state_;
std::string snapshot_;
StreamBuffer snapshot_;
public:
LuaSnap();
@@ -32,11 +32,11 @@ public:
// Serialize the state of the lua interpreter.
//
void serialize(Packer *pk);
void serialize(StreamBuffer *sb);
// Restore the the lua interpreter given a serialized state.
//
void deserialize(Unpacker *unpk);
void deserialize(StreamBuffer *sb);
// Return true if there's a saved snapshot.
//
@@ -53,7 +53,6 @@ public:
// If there is no snapshot, this panics.
//
void rollback();
};