🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::Referenced类 参考
+ 类 ast::Referenced 继承关系图:

Public 成员函数

 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 成员函数

void setDestructed ()
 

友元

A_ALWAYS_INLINE friend uint32_t aObject_IncRef (Referenced *obj)
 
A_ALWAYS_INLINE friend uint32_t aObject_DecRef (Referenced *obj)
 
A_ALWAYS_INLINE friend uint32_t aObject_IncWeakRef (Referenced *obj)
 
A_ALWAYS_INLINE friend uint32_t aObject_DecWeakRef (Referenced *obj)
 
A_ALWAYS_INLINE friend bool aObject_IsDestructed (const Referenced *obj)
 

构造及析构函数说明

◆ Referenced()

ast::Referenced::Referenced ( initial_strong_ref_t )
inlineexplicit

构造函数,用于初始化对象的强引用计数为1

参数
initial_strong_ref_t初始化强引用计数的标记

成员函数说明

◆ decRef()

uint32_t ast::Referenced::decRef ( )
inline

减少强引用计数

返回
uint32_t 新的强引用计数

◆ decRefNoDelete()

uint32_t ast::Referenced::decRefNoDelete ( )
inline

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

返回
uint32_t 新的强引用计数

◆ decWeakRef()

uint32_t ast::Referenced::decWeakRef ( )
inline

减少弱引用计数

返回
uint32_t 新的弱引用计数

◆ destruct()

void ast::Referenced::destruct ( )
inline

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

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

警告
对于栈上的对象,不要调用该函数,避免对栈内存调用 delete 导致崩溃

◆ incRef()

uint32_t ast::Referenced::incRef ( )
inline

增加强引用计数

返回
uint32_t 新的强引用计数

◆ incWeakRef()

uint32_t ast::Referenced::incWeakRef ( )
inline

增加弱引用计数

返回
uint32_t 新的弱引用计数

◆ isDestructed()

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

判断对象是否被析构

返回
bool 是否已析构

◆ refCount()

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

获取强引用计数

返回
uint32_t 强引用计数

◆ weakRefCount()

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

获取弱引用计数

返回
uint32_t 弱引用计数

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