载入中...
搜索中...
未找到

#include <Module.h>

struct  ModuleInfo
 

Public 类型

typedef Module *(* creator_t) ()
 
typedef void(* exposer_t) (ssq::Table &)
 

静态 Public 成员函数

static ModuleManagerinst ()
 Singleton registry holding every registered engine module.
 
static Modulefind (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 Runtimeruntime ()
 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, ModuleInforegistered_modules
 
Runtimeactive_runtime_ = nullptr
 

详细描述

在文件 Module.h49 行定义.

成员类型定义说明

◆ creator_t

typedef Module *(* eve::ModuleManager::creator_t) ()

在文件 Module.h51 行定义.

◆ exposer_t

typedef void(* eve::ModuleManager::exposer_t) (ssq::Table &)

在文件 Module.h52 行定义.

成员函数说明

◆ detach()

void eve::ModuleManager::detach ( Runtime runtime)
static

Clears the active runtime if it matches; called during shutdown.

在文件 Module.cpp75 行定义.

引用了 active_runtime_, inst() , 以及 runtime().

被这些函数引用 eve::Runtime::initialize() , 以及 eve::Runtime::shutdown().

◆ expose() [1/2]

void eve::ModuleManager::expose ( Runtime runtime)
static

Exposes every registered module into the given runtime's root table.

在文件 Module.cpp58 行定义.

引用了 active_runtime_, exposeVM(), inst(), runtime() , 以及 eve::Runtime::vm().

被这些函数引用 eve::Runtime::initialize().

◆ expose() [2/2]

void eve::ModuleManager::expose ( ssq::VM &  vm)
static

在文件 Module.cpp63 行定义.

引用了 active_runtime_, exposeVM(), inst() , 以及 vm().

◆ expose_pending()

int eve::ModuleManager::expose_pending ( )
static

在文件 Module.cpp79 行定义.

引用了 active, active_runtime_, eve::Runtime::enter(), inst(), registered_modules , 以及 scope.

被这些函数引用 eve::plugins::Plugins::load().

◆ exposeVM()

void eve::ModuleManager::exposeVM ( ssq::VM &  vm)
staticprotected

在文件 Module.cpp44 行定义.

引用了 eve::exposeECS(), inst(), registered_modules , 以及 vm().

被这些函数引用 expose() , 以及 expose().

◆ find()

Module * eve::ModuleManager::find ( const char *  name)
static

Finds a live module instance by name, or nullptr.

在文件 Module.cpp17 行定义.

引用了 EV_PARAM_CHECK, inst(), name, p , 以及 registered_modules.

◆ getInstance()

template<typename T >
static T * eve::ModuleManager::getInstance ( const char *  name)
inlinestatic

Casts the registered instance of a module to T (may be null).

在文件 Module.h79 行定义.

引用了 name.

◆ insert()

void eve::ModuleManager::insert ( const char *  name,
Module inst 
)
static

Stores a module instance under a name (used by Module_IMPL).

在文件 Module.cpp24 行定义.

引用了 EV_PARAM_CHECK, inst(), name , 以及 registered_modules.

◆ inst()

ModuleManager & eve::ModuleManager::inst ( )
static

Singleton registry holding every registered engine module.

在文件 Module.cpp12 行定义.

被这些函数引用 detach(), expose(), expose(), expose_pending(), exposeVM(), find(), insert(), register_module() , 以及 runtime().

◆ register_module()

void eve::ModuleManager::register_module ( const char *  name,
creator_t  c,
exposer_t  e 
)
static

Registers a module factory (creator + script exposer) by name.

在文件 Module.cpp30 行定义.

引用了 c, EV_PARAM_CHECK, inst(), name, p , 以及 registered_modules.

被这些函数引用 eve::ModuleRegister::ModuleRegister().

◆ requireInstance()

template<typename T >
static T * eve::ModuleManager::requireInstance ( const char *  name)
inlinestatic

Returns the live instance, creating it lazily through the registered factory.

在文件 Module.h85 行定义.

引用了 name.

◆ runtime()

Runtime * eve::ModuleManager::runtime ( )
static

Active runtime associated with the last expose() call, or nullptr.

在文件 Module.cpp68 行定义.

引用了 active_runtime_ , 以及 inst().

被这些函数引用 detach(), expose() , 以及 vm().

◆ vm()

ssq::VM * eve::ModuleManager::vm ( )
static

Script VM of the active runtime, or nullptr.

在文件 Module.cpp70 行定义.

引用了 active , 以及 runtime().

被这些函数引用 expose() , 以及 exposeVM().

类成员变量说明

◆ active_runtime_

Runtime* eve::ModuleManager::active_runtime_ = nullptr
protected

在文件 Module.h102 行定义.

被这些函数引用 detach(), expose(), expose(), expose_pending() , 以及 runtime().

◆ registered_modules

std::unordered_map<std::string, ModuleInfo> eve::ModuleManager::registered_modules
protected

在文件 Module.h101 行定义.

被这些函数引用 expose_pending(), exposeVM(), find(), insert() , 以及 register_module().


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