|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <Object.hpp>
类 ast::Object 继承关系图:Public 成员函数 | |
| Object (Object *parentScope) | |
| Object (std::nullptr_t) | |
| virtual Class * | getType () const |
| virtual const std::string & | getName () const |
| errc_t | openEditDialog () |
| 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 |
| double | getAttrDouble (StringView path) const |
| int | getAttrInt (StringView path) const |
| bool | getAttrBool (StringView path) const |
| std::string | getAttrString (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) |
| Class * | type () const |
| Property * | getProperty (StringView fieldName) const |
| uint32_t | getID () const |
| errc_t | setParentScope (Object *parentScope) |
| Object * | getParentScope () const |
| 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 Class * | getStaticType () |
静态 Public 属性 | |
| static Class | staticType |
Protected 成员函数 | |
| Object (const Object &obj) | |
| Object & | operator= (const Object &obj) |
友元 | |
| class | ObjectManager |
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
参考了Qt的QObject类、UE的UObject类、以及Python的PyObject等类的设计和实现
| Attribute ast::Object::attr | ( | StringView | path | ) |
获取属性,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
|
inline |
减少强引用计数
|
inline |
减少强引用计数,不删除对象
|
inline |
减少弱引用计数
|
inline |
析构对象,仅当强引用计数为0时才会被调用
析构对象时,会先将弱引用计数减1,若弱引用计数为0,则会调用析构函数
| 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 | 属性值引用 |
| 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 |
| Object * ast::Object::getParentScope | ( | ) | const |
获取对象的父作用域
| Property * ast::Object::getProperty | ( | StringView | fieldName | ) | const |
获取属性元信息
| fieldName | 属性名 |
|
virtual |
获取对象的类型元信息
|
inline |
增加强引用计数
|
inline |
增加弱引用计数
|
inline |
判断对象是否被析构
| errc_t ast::Object::openEditDialog | ( | ) |
打开编辑对话框,用于编辑对象的属性
|
inline |
获取强引用计数
| 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::setAttrString | ( | StringView | path, |
| StringView | value ) |
设置属性值,属性路径格式为 "attr1.attr2.attr3"
| path | 属性路径 |
| value | 属性值 |
| errc_t ast::Object::setParentScope | ( | Object * | parentScope | ) |
设置对象的父作用域
| parentScope | 父作用域指针 |
|
inline |
获取对象类型
|
inline |
获取弱引用计数