载入中...
搜索中...
未找到
eve::dev::ReloadSession类 参考

One state hot-reload transaction: capture → reload → restore. 更多...

#include <ReloadSession.h>

Public 成员函数

 ReloadSession (const ReloadSession &)=delete
 
ReloadSessionoperator= (const ReloadSession &)=delete
 
bool begin (HSQUIRRELVM vm, std::string *err=nullptr)
 Start a session: capture current script + native state.
 
bool commit (HSQUIRRELVM vm, std::string *err=nullptr)
 End the session, restoring captured state over the new definitions (old values win; newly added fields kept).
 
bool abort (HSQUIRRELVM vm, std::string *err=nullptr)
 End the session, rolling back to the captured state.
 
bool active () const
 Whether a session is currently open.
 

静态 Public 成员函数

static ReloadSessioninstance ()
 

详细描述

One state hot-reload transaction: capture → reload → restore.

A script reload (soft_reload_scripts) drives this via the eve.dev API:

  1. begin(): snapshot script state roots + every registered IStateProvider into an in-memory buffer, and persist eve_snapshot.json as a manual rollback point.
  2. (scripts are re-dofile'd in between)
  3. commit(): restore the captured state on top of the new definitions — captured root values win, fields the new script added are kept, native providers are restored (falling back to resetToDefaults() on failure).
  4. abort(): restore the captured state unchanged and clear the session.

在文件 ReloadSession.h27 行定义.

构造及析构函数说明

◆ ReloadSession()

eve::dev::ReloadSession::ReloadSession ( const ReloadSession )
delete

成员函数说明

◆ abort()

bool eve::dev::ReloadSession::abort ( HSQUIRRELVM  vm,
std::string *  err = nullptr 
)

End the session, rolling back to the captured state.

在文件 ReloadSession.cpp59 行定义.

引用了 eve::StateValue::null(), ok , 以及 vm.

◆ active()

bool eve::dev::ReloadSession::active ( ) const
inline

Whether a session is currently open.

在文件 ReloadSession.h50 行定义.

◆ begin()

bool eve::dev::ReloadSession::begin ( HSQUIRRELVM  vm,
std::string *  err = nullptr 
)

Start a session: capture current script + native state.

返回
false when capture fails (session stays inactive).

在文件 ReloadSession.cpp12 行定义.

引用了 eve::dev::Snapshot::instance(), eve::StateValue::null(), eve::dev::Snapshot::saveFile() , 以及 vm.

◆ commit()

bool eve::dev::ReloadSession::commit ( HSQUIRRELVM  vm,
std::string *  err = nullptr 
)

End the session, restoring captured state over the new definitions (old values win; newly added fields kept).

在文件 ReloadSession.cpp28 行定义.

引用了 eve::StateValue::find(), eve::dev::Snapshot::instance(), eve::StateValue::isObject(), eve::StateValue::keys(), eve::StateValue::mergeDefaults(), name, eve::StateValue::null(), ok , 以及 vm.

◆ instance()

ReloadSession & eve::dev::ReloadSession::instance ( )
static

在文件 ReloadSession.cpp7 行定义.

被这些函数引用 eve::dev::DevTool::exposeScriptApi().

◆ operator=()

ReloadSession & eve::dev::ReloadSession::operator= ( const ReloadSession )
delete

该类的文档由以下文件生成: