目录

RefCount

Class Info

class RefCount

资源引用计数类。包含资源引用计数的增加、减少,以及判断资源是否可销毁等功能。

Public Constructor Summary

Constructor Name

RefCount()

构造函数。

Public Destructor Summary

Destructor Name

virtual ~RefCount()

析构函数。

Public Method Summary

Qualifier and Type

Method Name and Description

void

IncRef()

资源的引用计数增加1。

void

DecRef()

资源的引用计数减少1。

bool

CanDestroy()

判断资源是否可销毁。

s32

GetRef()

获取资源的引用次数。

Public Constructors

[h2]RefCount

Constructor

RefCount()

构造函数。

Public Destructors

[h2]~RefCount

Destructor

virtual ~RefCount()

析构函数。

Public Methods

[h2]IncRef

Method

void IncRef()

资源的引用计数增加1。

[h2]DecRef

Method

void DecRef()

资源的引用计数减少1。

[h2]CanDestroy

Method

bool CanDestroy()

判断资源是否可销毁。

Returns

Type

Description

bool

  • true:引用计数值为0。
  • false:引用计数值为其他值。

[h2]GetRef

Method

s32 GetRef()

获取资源的引用次数。

Returns

Type

Description

s32

返回资源的引用次数。