载入中...
搜索中...
未找到
ReloadSession.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/StateValue.h"
5
6#include <string>
7#include <vector>
8
9struct SQVM;
10typedef struct SQVM* HSQUIRRELVM;
11
12namespace eve::dev {
13
29public:
31 static ReloadSession& instance();
32
33 ReloadSession(const ReloadSession&) = delete;
35
40 bool begin(HSQUIRRELVM vm, std::string* err = nullptr);
41
48 bool commit(HSQUIRRELVM vm, std::string* err = nullptr);
49
51 bool abort(HSQUIRRELVM vm, std::string* err = nullptr);
52
54 bool active() const { return active_; }
55
56private:
57 ReloadSession() = default;
58
59 bool restore(HSQUIRRELVM vm, const StateValue& state, std::string* err);
60
61 StateValue buffer_;
62 std::vector<std::string> persistentRoots_;
63 std::vector<std::string> transientRoots_;
64 bool active_ = false;
65};
66
67} // namespace eve::dev
struct SQVM * HSQUIRRELVM
HSQUIRRELVM vm
Definition ECS.cpp:20
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
float begin
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