#include <Module.h>
类 | |
| struct | ModuleInfo |
Public 类型 | |
| typedef Module *(* | creator_t) () |
| typedef void(* | exposer_t) (ssq::Table &) |
静态 Public 成员函数 | |
| static ModuleManager & | inst () |
| Singleton registry holding every registered engine module. | |
| static Module * | find (const char *name) |
| Finds a live module instance by name, or nullptr. | |
| static void | insert (const char *name, Module *inst) |
| Stores a module instance under a name (used by Module_IMPL). | |
| static void | register_module (const char *name, creator_t c, exposer_t e) |
| Registers a module factory (creator + script exposer) by name. | |
| static void | expose (Runtime &runtime) |
| Exposes every registered module into the given runtime's root table. | |
| static void | expose (ssq::VM &vm) |
| static int | expose_pending () |
| static Runtime * | runtime () |
| Active runtime associated with the last expose() call, or nullptr. | |
| static ssq::VM * | vm () |
| Script VM of the active runtime, or nullptr. | |
| static void | detach (Runtime *runtime) |
| Clears the active runtime if it matches; called during shutdown. | |
| template<typename T > | |
| static T * | getInstance (const char *name) |
| Casts the registered instance of a module to T (may be null). | |
| template<typename T > | |
| static T * | requireInstance (const char *name) |
| Returns the live instance, creating it lazily through the registered factory. | |
静态 Protected 成员函数 | |
| static void | exposeVM (ssq::VM &vm) |
Protected 属性 | |
| std::unordered_map< std::string, ModuleInfo > | registered_modules |
| Runtime * | active_runtime_ = nullptr |
详细描述
成员类型定义说明
◆ creator_t
◆ exposer_t
成员函数说明
◆ detach()
|
static |
Clears the active runtime if it matches; called during shutdown.
在文件 Module.cpp 第 75 行定义.
引用了 active_runtime_, inst() , 以及 runtime().
被这些函数引用 eve::Runtime::initialize() , 以及 eve::Runtime::shutdown().
◆ expose() [1/2]
|
static |
Exposes every registered module into the given runtime's root table.
在文件 Module.cpp 第 58 行定义.
引用了 active_runtime_, exposeVM(), inst(), runtime() , 以及 eve::Runtime::vm().
被这些函数引用 eve::Runtime::initialize().
◆ expose() [2/2]
|
static |
在文件 Module.cpp 第 63 行定义.
引用了 active_runtime_, exposeVM(), inst() , 以及 vm().
◆ expose_pending()
|
static |
在文件 Module.cpp 第 79 行定义.
引用了 active, active_runtime_, eve::Runtime::enter(), inst(), registered_modules , 以及 scope.
被这些函数引用 eve::plugins::Plugins::load().
◆ exposeVM()
|
staticprotected |
在文件 Module.cpp 第 44 行定义.
引用了 eve::exposeECS(), inst(), registered_modules , 以及 vm().
◆ find()
|
static |
Finds a live module instance by name, or nullptr.
在文件 Module.cpp 第 17 行定义.
引用了 EV_PARAM_CHECK, inst(), name, p , 以及 registered_modules.
◆ getInstance()
|
inlinestatic |
◆ insert()
|
static |
Stores a module instance under a name (used by Module_IMPL).
在文件 Module.cpp 第 24 行定义.
引用了 EV_PARAM_CHECK, inst(), name , 以及 registered_modules.
◆ inst()
|
static |
Singleton registry holding every registered engine module.
在文件 Module.cpp 第 12 行定义.
被这些函数引用 detach(), expose(), expose(), expose_pending(), exposeVM(), find(), insert(), register_module() , 以及 runtime().
◆ register_module()
Registers a module factory (creator + script exposer) by name.
在文件 Module.cpp 第 30 行定义.
引用了 c, EV_PARAM_CHECK, inst(), name, p , 以及 registered_modules.
◆ requireInstance()
|
inlinestatic |
◆ runtime()
|
static |
Active runtime associated with the last expose() call, or nullptr.
在文件 Module.cpp 第 68 行定义.
引用了 active_runtime_ , 以及 inst().
◆ vm()
|
static |
Script VM of the active runtime, or nullptr.
在文件 Module.cpp 第 70 行定义.
被这些函数引用 expose() , 以及 exposeVM().
类成员变量说明
◆ active_runtime_
|
protected |
◆ registered_modules
|
protected |
被这些函数引用 expose_pending(), exposeVM(), find(), insert() , 以及 register_module().
该类的文档由以下文件生成:
- src/engine/common/Module.h
- src/engine/common/Module.cpp