Reflectable script-object registry backing the database panel. 更多...
#include <ObjectRegistry.h>
Public 成员函数 | |
| ObjectRegistry (const ObjectRegistry &)=delete | |
| ObjectRegistry & | operator= (const ObjectRegistry &)=delete |
| uint64_t | create (const std::string &className) |
| Creates a class instance through the active Runtime and registers it. | |
| uint64_t | registerObject (const std::string &className, const ssq::Object &object, const std::string &label={}) |
| Registers an existing live script instance. | |
| bool | unregister (uint64_t id) |
| Removes an entry by id (the object itself stays alive). | |
| void | clear (const std::string &className) |
| Removes every entry of a class. | |
| void | clearAll () |
| Removes every entry. | |
| std::vector< std::string > | classNames () const |
| Class names with at least one entry, sorted. | |
| std::vector< ObjectEntry > | entries (const std::string &className) const |
| Entries of a class, in registration order. | |
| const ObjectEntry * | entry (uint64_t id) const |
| Look up one entry by id; nullptr when unknown. | |
| size_t | count (const std::string &className) const |
| Number of entries of a class. | |
静态 Public 成员函数 | |
| static ObjectRegistry & | instance () |
详细描述
Reflectable script-object registry backing the database panel.
Holds rooted references to script class instances grouped by class name. The database panel lists entries per class, creates instances through the active Runtime and edits their reflected properties; scripts register their own live objects through ui.dbRegister(obj).
在文件 ObjectRegistry.h 第 30 行定义.
构造及析构函数说明
◆ ObjectRegistry()
|
delete |
成员函数说明
◆ classNames()
| std::vector< std::string > eve::ui::ObjectRegistry::classNames | ( | ) | const |
Class names with at least one entry, sorted.
在文件 ObjectRegistry.cpp 第 69 行定义.
◆ clear()
| void eve::ui::ObjectRegistry::clear | ( | const std::string & | className | ) |
Removes every entry of a class.
在文件 ObjectRegistry.cpp 第 61 行定义.
◆ clearAll()
| void eve::ui::ObjectRegistry::clearAll | ( | ) |
Removes every entry.
在文件 ObjectRegistry.cpp 第 65 行定义.
◆ count()
| size_t eve::ui::ObjectRegistry::count | ( | const std::string & | className | ) | const |
◆ create()
| uint64_t eve::ui::ObjectRegistry::create | ( | const std::string & | className | ) |
Creates a class instance through the active Runtime and registers it.
- 参数
-
className Reflected script class name.
- 返回
- The new entry id, or 0 when the class is unknown / construction failed.
在文件 ObjectRegistry.cpp 第 15 行定义.
引用了 eve::Runtime::createInstance(), registerObject() , 以及 eve::ModuleManager::runtime().
◆ entries()
| std::vector< ObjectEntry > eve::ui::ObjectRegistry::entries | ( | const std::string & | className | ) | const |
◆ entry()
| const ObjectEntry * eve::ui::ObjectRegistry::entry | ( | uint64_t | id | ) | const |
Look up one entry by id; nullptr when unknown.
在文件 ObjectRegistry.cpp 第 82 行定义.
被这些函数引用 registerObject().
◆ instance()
|
static |
◆ operator=()
|
delete |
◆ registerObject()
| uint64_t eve::ui::ObjectRegistry::registerObject | ( | const std::string & | className, |
| const ssq::Object & | object, | ||
| const std::string & | label = {} |
||
| ) |
Registers an existing live script instance.
- 参数
-
className Class name used for grouping (auto-derived when empty). object Live script instance (rooted while registered). label Optional display label (defaults to "Class #n").
- 返回
- The entry id, or 0 on failure.
在文件 ObjectRegistry.cpp 第 26 行定义.
引用了 eve::ui::ObjectEntry::className, eve::Runtime::classNameOf(), count(), entry(), group, id, eve::ui::ObjectEntry::id, eve::ui::ObjectEntry::label, eve::ui::ObjectEntry::object , 以及 eve::ModuleManager::runtime().
被这些函数引用 create() , 以及 eve::ui::DatabasePanel::registerObject().
◆ unregister()
| bool eve::ui::ObjectRegistry::unregister | ( | uint64_t | id | ) |
Removes an entry by id (the object itself stays alive).
在文件 ObjectRegistry.cpp 第 48 行定义.
引用了 entries().
被这些函数引用 eve::ui::DatabasePanel::unregister().
该类的文档由以下文件生成:
- src/modules/ui/ObjectRegistry.h
- src/modules/ui/ObjectRegistry.cpp