载入中...
搜索中...
未找到
ReloadSession.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/StateValue.h"
5
6#include <string>
7
8struct SQVM;
9typedef struct SQVM* HSQUIRRELVM;
10
11namespace eve::dev {
12
28public:
29 static ReloadSession& instance();
30
31 ReloadSession(const ReloadSession&) = delete;
33
38 bool begin(HSQUIRRELVM vm, std::string* err = nullptr);
39
44 bool commit(HSQUIRRELVM vm, std::string* err = nullptr);
45
47 bool abort(HSQUIRRELVM vm, std::string* err = nullptr);
48
50 bool active() const { return active_; }
51
52private:
53 ReloadSession() = default;
54
55 bool restore(HSQUIRRELVM vm, const StateValue& state, std::string* err);
56
57 StateValue buffer_;
58 bool active_ = false;
59};
60
61} // namespace eve::dev
struct SQVM * HSQUIRRELVM
HSQUIRRELVM vm
Definition ECS.cpp:20
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
JobSystemThreadPool::State * state
struct SQVM * HSQUIRRELVM
JSON-compatible state value tree used by state hot reload.
Definition StateValue.h:20
One state hot-reload transaction: capture → reload → restore.
ReloadSession(const ReloadSession &)=delete
bool active() const
Whether a session is currently open.
ReloadSession & operator=(const ReloadSession &)=delete