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

#include <Class.hpp>

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

Public 类型

typedef Object *(*) FConstructor(Object *parentScope)
 
typedef Object *(*) FResolve(StringView value)
 
- Public 类型 继承自 ast::Struct
using PropertyMap = std::unordered_map<std::string, Property*>
 
using PropertyList = std::vector<Property*>
 

Public 成员函数

 AST_OBJECT (Class)
 
 Class (Class *parent=nullptr)
 
Objectcast (Object *obj) const
 
const Objectcast (const Object *obj) const
 
bool isVirtual () const
 
ClassgetParent () const
 
void addToRegistry () const
 
ObjectnewObject (Object *parentScope) const
 
Objectresolve (StringView value) const
 
ObjectgetDefaultObject () const
 
void setParent (Class *parent)
 
void setConstructor (FConstructor constructor)
 
void setResolve (FResolve resolve)
 
template<typename T >
void setParent ()
 
template<typename T >
std::enable_if<!std::is_abstract< T >::value >::type setConstructor ()
 
template<typename T >
std::enable_if< std::is_abstract< T >::value >::type setConstructor ()
 
template<typename T >
void setResolve ()
 
void getAllProperties (std::vector< Property * > &out, bool overwriteSameName=false) const
 
 Struct ()
 
- Public 成员函数 继承自 ast::Struct
const std::string & getName () const final
 
void setName (StringView name) final
 
const std::string & desc () const
 
void setDesc (StringView desc)
 
PropertyaddProperty (StringView name, Property *property)
 
PropertyaddProperty (Property *property)
 
PropertygetProperty (StringView name)
 
const PropertyList & getProperties () const
 
std::string getModuleName () const
 
- Public 成员函数 继承自 ast::Object
 Object (Object *parentScope)
 
 Object (std::nullptr_t)
 
virtual ClassgetType () const
 
virtual std::string getRepresentation () const
 
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
 
ObjectgetAttrObject (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)
 
Classtype () const
 
const std::string & typeName () const
 
PropertygetProperty (StringView fieldName) const
 
ObjectId getID () const
 
errc_t setParentScope (Object *parentScope)
 
ObjectgetParentScope () const
 
template<typename 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 ()
 

Protected 属性

Classparent_ {nullptr}
 
FConstructor constructor_ {nullptr}
 
FResolve resolve_ {nullptr}
 
SharedPtr< ObjectdefaultObject_ {nullptr}
 
- Protected 属性 继承自 ast::Struct
std::string name_
 
std::string desc_
 
PropertyList properties_
 
PropertyMap propertyMap_
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 ast::Object
static ObjectResolve (StringView value)
 
static void ClassInit (Class *cls)
 
static ClassStaticType ()
 
- 静态 Public 属性 继承自 ast::Object
static Class staticType
 
- Protected 成员函数 继承自 ast::Object
 Object (const Object &obj)
 
Objectoperator= (const Object &)
 
- Protected 成员函数 继承自 ast::Referenced
void setDestructed ()
 

详细描述

类元信息

类元信息,包含类的名称、属性、方法等

待办事项
实现类的反射机制

构造及析构函数说明

◆ Class()

ast::Class::Class ( Class * parent = nullptr)
explicit

构造函数

参数
parent父类指针

成员函数说明

◆ cast()

Object * ast::Class::cast ( Object * obj) const

类型转换

参数
obj输入对象指针
返回
Object* 转换后的对象指针

◆ getAllProperties()

void ast::Class::getAllProperties ( std::vector< Property * > & out,
bool overwriteSameName = false ) const

获取所有属性(含继承链)

参数
out输出属性指针向量
overwriteSameName是否覆盖父类的同名属性

◆ getDefaultObject()

Object * ast::Class::getDefaultObject ( ) const

获取默认对象

返回
Object* 默认对象指针

◆ getParent()

Class * ast::Class::getParent ( ) const
inline

获取父类

返回
Class* 父类指针

◆ isVirtual()

bool ast::Class::isVirtual ( ) const
inline

检查类是否为虚类

返回
是否为虚类

◆ newObject()

Object * ast::Class::newObject ( Object * parentScope) const

创建新对象

返回
Object* 新对象指针

◆ resolve()

Object * ast::Class::resolve ( StringView value) const

解析字符串

参数
value字符串值
返回
Object* 解析结果

◆ setConstructor() [1/2]

template<typename T >
std::enable_if<!std::is_abstract< T >::value >::type ast::Class::setConstructor ( )
inline

设置构造函数

警告
内部使用,不建议外部调用,否则可能导致未定义行为
参数
T构造函数类型

◆ setConstructor() [2/2]

void ast::Class::setConstructor ( FConstructor constructor)
inline

设置构造函数

警告
内部使用,不建议外部调用,否则可能导致未定义行为
参数
constructor构造函数指针

◆ setParent() [1/2]

template<typename T >
void ast::Class::setParent ( )
inline

设置父类

警告
内部使用,不建议外部调用,否则可能导致未定义行为
参数
T父类类型

◆ setParent() [2/2]

void ast::Class::setParent ( Class * parent)
inline

设置父类

警告
内部使用,不建议外部调用,否则可能导致未定义行为
参数
parent父类指针

◆ setResolve()

void ast::Class::setResolve ( FResolve resolve)
inline

设置解析函数

参数
resolve解析函数指针

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