|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <Object.hpp>
类 ast::Object 继承关系图:Public 成员函数 | |
| Object (Object *parentScope) | |
| Object (std::nullptr_t) | |
| virtual Class * | getType () const |
| virtual std::string | getRepresentation () const |
| virtual const std::string & | getName () const |
| virtual void | setName (StringView name)=0 |
| const std::string & | name () const |
| std::string | displayName () const |
| errc_t | showEditDialog () |
| Attribute | attr (StringView path) |
| errc_t | getAttrBool (StringView path, bool &value) const |
| errc_t | getAttrInt (StringView path, int &value) const |
| errc_t | getAttrDouble (StringView path, double &value) const |
| errc_t | getAttrString (StringView path, std::string &value) const |
| errc_t | getAttrObject (StringView path, Object *&value) const |
| double | getAttrDouble (StringView path) const |
| int | getAttrInt (StringView path) const |
| bool | getAttrBool (StringView path) const |
| std::string | getAttrString (StringView path) const |
| Object * | getAttrObject (StringView path) const |
| errc_t | setAttrBool (StringView path, bool value) |
| errc_t | setAttrInt (StringView path, int value) |
| errc_t | setAttrDouble (StringView path, double value) |
| errc_t | setAttrString (StringView path, StringView value) |
| errc_t | setAttrObject (StringView path, Object *value) |
| Class * | type () const |
| const std::string & | typeName () const |
| Property * | getProperty (StringView fieldName) const |
| ObjectId | getID () const |
| errc_t | setParentScope (Object *parentScope) |
| Object * | getParentScope () const |
| template<typename T > | |
| T | getParent () const |
| bool | isOfType (const Class *type) const |
| bool | isOfType (StringView typeName) const |
| template<typename T > | |
| bool | isOfType () const |
| template<typename Func > | |
| void | addDelayedLink (Func &&link) |
| template<typename Func > | |
| void | addDelayedLinkIfFailed (Func &&link) |
| void | resolveLinks () |
| bool | readOnly () const |
| void | setReadOnly (bool readOnly) |
| bool | active () const |
| void | setActive (bool active) |
| bool | isComponent () const |
| void | setIsComponent (bool isComponent) |
| bool | isEntity () const |
| void | setIsEntity (bool isEntity) |
| const char * | tr (const char *msg) const |
| Referenced () | |
| Referenced (initial_strong_ref_t) | |
Public 成员函数 继承自 ast::Referenced | |
| Referenced (initial_strong_ref_t) | |
| uint32_t | refCount () const |
| uint32_t | weakRefCount () const |
| bool | isDestructed () const |
| void | destruct () |
| uint32_t | incWeakRef () |
| uint32_t | decWeakRef () |
| uint32_t | incRef () |
| uint32_t | decRef () |
| uint32_t | decRefNoDelete () |
静态 Public 成员函数 | |
| static Object * | Resolve (StringView value) |
| static void | ClassInit (Class *cls) |
| static Class * | StaticType () |
静态 Public 属性 | |
| static Class | staticType |
Protected 成员函数 | |
| Object (const Object &obj) | |
| Object & | operator= (const Object &) |
Protected 成员函数 继承自 ast::Referenced | |
| void | setDestructed () |
友元 | |
| class | ObjectManager |
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
参考了Qt的QObject类、UE的UObject类、以及Python的PyObject等类的设计和实现
|
inline |
|
inline |
| Attribute ast::Object::attr | ( | StringView | path | ) |
获取属性,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| bool ast::Object::getAttrBool | ( | StringView | path | ) | const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| errc_t ast::Object::getAttrBool | ( | StringView | path, |
| bool & | value ) const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值引用 |
| double ast::Object::getAttrDouble | ( | StringView | path | ) | const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| errc_t ast::Object::getAttrDouble | ( | StringView | path, |
| double & | value ) const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值引用 |
| int ast::Object::getAttrInt | ( | StringView | path | ) | const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| errc_t ast::Object::getAttrInt | ( | StringView | path, |
| int & | value ) const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值引用 |
| Object * ast::Object::getAttrObject | ( | StringView | path | ) | const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| errc_t ast::Object::getAttrObject | ( | StringView | path, |
| Object *& | value ) const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值引用 |
| std::string ast::Object::getAttrString | ( | StringView | path | ) | const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| errc_t ast::Object::getAttrString | ( | StringView | path, |
| std::string & | value ) const |
获取属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值引用 |
| uint32_t ast::Object::getID | ( | ) | const |
获取对象ID
|
virtual |
获取对象的名称
被 ast::Facility, ast::Mover, ast::ObjectNamed, ast::Scenario, ast::Sensor , 以及 ast::Struct 重载.
| Object * ast::Object::getParentScope | ( | ) | const |
获取对象的父作用域
| Property * ast::Object::getProperty | ( | StringView | fieldName | ) | const |
获取属性元信息
| fieldName | 属性名 |
|
virtual |
|
virtual |
获取对象的类型元信息
| bool ast::Object::isOfType | ( | const Class * | type | ) | const |
判断对象是否为指定类型的实例
| type | 类型元信息 |
| bool ast::Object::isOfType | ( | StringView | typeName | ) | const |
判断对象是否为指定类型的实例
| typeName | 类型名 |
|
inlineexplicit |
构造函数,用于初始化对象的强引用计数为1
| initial_strong_ref_t | 初始化强引用计数的标记 |
|
static |
解析字符串
| value | 字符串值 |
| A_ALWAYS_INLINE void ast::Object::resolveLinks | ( | ) |
| errc_t ast::Object::setAttrBool | ( | StringView | path, |
| bool | value ) |
| path | 属性路径 |
| value | 属性值 |
| errc_t ast::Object::setAttrDouble | ( | StringView | path, |
| double | value ) |
设置属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值 |
| errc_t ast::Object::setAttrInt | ( | StringView | path, |
| int | value ) |
设置属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值 |
| errc_t ast::Object::setAttrObject | ( | StringView | path, |
| Object * | value ) |
设置属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值 |
| errc_t ast::Object::setAttrString | ( | StringView | path, |
| StringView | value ) |
设置属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值 |
|
pure virtual |
设置对象的名称
| name | 对象名称 |
在 ast::Facility, ast::Mover, ast::ObjectNamed, ast::Scenario, ast::Sensor , 以及 ast::Struct 内被实现.
| errc_t ast::Object::setParentScope | ( | Object * | parentScope | ) |
设置对象的父作用域
| parentScope | 父作用域指针 |
| errc_t ast::Object::showEditDialog | ( | ) |
显示编辑对话框,用于编辑对象的属性
|
inline |
获取对象类型