StrongReferenceCounter Class Reference 内存
#include <atomictypes.h>
Atomic reference counter.
Public Types |
|
using | ValueType = UInt |
公共成员函数 |
|
StrongReferenceCounter () | |
StrongReferenceCounter (const StrongReferenceCounter &) | |
void | operator= (const StrongReferenceCounter &) |
Bool | Inc () |
Bool | Dec () |
Bool | ConditionalInc () |
void | 添加 ( UInt additionalReferences) |
void | SetRelaxed ( UInt referenceCount) |
operator UInt () const | |
Bool | HasMultipleReferences () const |
静态公共成员函数 |
|
static const StrongReferenceCounter & | NullValue () |
static StrongReferenceCounter & | Get (const void *object) |
Protected Attributes |
|
AtomicUInt | _value |
using ValueType = UInt |
The underlying integral type of this reference counter.
StrongReferenceCounter | ( | ) |
StrongReferenceCounter | ( | const StrongReferenceCounter & | ) |
void operator= | ( | const StrongReferenceCounter & | ) |
Bool Inc | ( | ) |
Increments reference counter (the caller acquires a strong reference).
Bool Dec | ( | ) |
Decrements reference counter (the caller removes a strong reference).
Bool ConditionalInc | ( | ) |
Adds a reference if the object is still strongly referenced.
void Add | ( | UInt | additionalReferences | ) |
Adds references.
[in] | additionalReferences | The number of additional references to add. |
void SetRelaxed | ( | UInt | referenceCount | ) |
Sets a specifc reference count - for initialization only!
operator UInt | ( | ) | const |
Returns the number of strong references to the object.
Bool HasMultipleReferences | ( | ) | const |
Returns whether an object has more than a single reference. For an object without a reference it will return false. For an object with one reference it will return false. For an object with a single reference and weak references it will return true. For an object with two references it will return true.
|
static |
|
static |
Returns the reference counter for classes which do not implement custom AddReference/RemoveReference methods.
|
protected |