🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::Object类 参考

#include <Object.hpp>

+ 类 ast::Object 继承关系图:

Public 成员函数

 Object (Object *parentScope)
 
 Object (std::nullptr_t)
 
virtual ClassgetType () 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)
 
Classtype () const
 
PropertygetProperty (StringView fieldName) const
 
uint32_t getID () const
 
errc_t setParentScope (Object *parentScope)
 
ObjectgetParentScope () 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 ClassgetStaticType ()
 

静态 Public 属性

static Class staticType
 

Protected 成员函数

 Object (const Object &obj)
 
Objectoperator= (const Object &obj)
 

友元

class ObjectManager
 

详细描述

对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能

参考了Qt的QObject类、UE的UObject类、以及Python的PyObject等类的设计和实现

成员函数说明

◆ attr()

Attribute ast::Object::attr ( StringView path)

获取属性,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
返回
Attribute 属性

◆ decRef()

uint32_t ast::Object::decRef ( )
inline

减少强引用计数

返回
uint32_t 新的强引用计数

◆ decRefNoDelete()

uint32_t ast::Object::decRefNoDelete ( )
inline

减少强引用计数,不删除对象

返回
uint32_t 新的强引用计数

◆ decWeakRef()

uint32_t ast::Object::decWeakRef ( )
inline

减少弱引用计数

返回
uint32_t 新的弱引用计数

◆ destruct()

void ast::Object::destruct ( )
inline

析构对象,仅当强引用计数为0时才会被调用

析构对象时,会先将弱引用计数减1,若弱引用计数为0,则会调用析构函数

◆ getAttrBool() [1/2]

bool ast::Object::getAttrBool ( StringView path) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
返回
bool 属性值

◆ getAttrBool() [2/2]

errc_t ast::Object::getAttrBool ( StringView path,
bool & value ) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值引用
返回
errc_t 错误码

◆ getAttrDouble() [1/2]

double ast::Object::getAttrDouble ( StringView path) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
返回
double 属性值

◆ getAttrDouble() [2/2]

errc_t ast::Object::getAttrDouble ( StringView path,
double & value ) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值引用
返回
errc_t 错误码

◆ getAttrInt() [1/2]

int ast::Object::getAttrInt ( StringView path) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
返回
int 属性值

◆ getAttrInt() [2/2]

errc_t ast::Object::getAttrInt ( StringView path,
int & value ) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值引用
返回
errc_t 错误码

◆ getAttrString() [1/2]

std::string ast::Object::getAttrString ( StringView path) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
返回
std::string 属性值

◆ getAttrString() [2/2]

errc_t ast::Object::getAttrString ( StringView path,
std::string & value ) const

获取属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值引用
返回
errc_t 错误码

◆ getID()

uint32_t ast::Object::getID ( ) const

获取对象ID

返回
uint32_t 对象ID

◆ getName()

const std::string & ast::Object::getName ( ) const
virtual

获取对象的名称

返回
const char* 对象名称

ast::CelestialBody , 以及 ast::Mover 重载.

◆ getParentScope()

Object * ast::Object::getParentScope ( ) const

获取对象的父作用域

返回
Object* 父作用域指针

◆ getProperty()

Property * ast::Object::getProperty ( StringView fieldName) const

获取属性元信息

参数
fieldName属性名
返回
Property* 属性元信息

◆ getType()

Class * ast::Object::getType ( ) const
virtual

获取对象的类型元信息

返回
Class* 类型元信息指针

◆ incRef()

uint32_t ast::Object::incRef ( )
inline

增加强引用计数

返回
uint32_t 新的强引用计数

◆ incWeakRef()

uint32_t ast::Object::incWeakRef ( )
inline

增加弱引用计数

返回
uint32_t 新的弱引用计数

◆ isDestructed()

bool ast::Object::isDestructed ( ) const
inline

判断对象是否被析构

返回
bool 是否已析构

◆ openEditDialog()

errc_t ast::Object::openEditDialog ( )

打开编辑对话框,用于编辑对象的属性

返回
errc_t 错误码

◆ refCount()

uint32_t ast::Object::refCount ( ) const
inline

获取强引用计数

返回
uint32_t 强引用计数

◆ setAttrBool()

errc_t ast::Object::setAttrBool ( StringView path,
bool value )
参数
path属性路径
value属性值
返回
errc_t 错误码

◆ setAttrDouble()

errc_t ast::Object::setAttrDouble ( StringView path,
double value )

设置属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值
返回
errc_t 错误码

◆ setAttrInt()

errc_t ast::Object::setAttrInt ( StringView path,
int value )

设置属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值
返回
errc_t 错误码

◆ setAttrString()

errc_t ast::Object::setAttrString ( StringView path,
StringView value )

设置属性值,属性路径格式为 "attr1.attr2.attr3"

参数
path属性路径
value属性值
返回
errc_t 错误码

◆ setParentScope()

errc_t ast::Object::setParentScope ( Object * parentScope)

设置对象的父作用域

参数
parentScope父作用域指针
返回
errc_t 错误码

◆ type()

Class * ast::Object::type ( ) const
inline

获取对象类型

返回
Class* 类型元信息

◆ weakRefCount()

uint32_t ast::Object::weakRefCount ( ) const
inline

获取弱引用计数

返回
uint32_t 弱引用计数

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