Base interface for a reference counter object that stores the number of strong and weak references and the pointer to the object. It is necessary to separate reference counters from the object to support weak pointers.
More...
|
virtual Atomics::Long | AddStrongRef ()=0 |
| Increments the number of strong references by 1. More...
|
|
virtual Atomics::Long | ReleaseStrongRef ()=0 |
| Decrements the number of strong references by 1 and destroys the referenced object when the counter reaches zero. If there are no more weak references, destroys the reference counters object itself. More...
|
|
virtual Atomics::Long | AddWeakRef ()=0 |
| Increments the number of weak references by 1. More...
|
|
virtual Atomics::Long | ReleaseWeakRef ()=0 |
| Decrements the number of weak references by 1. If there are no more strong and weak references, destroys the reference counters object itself. More...
|
|
virtual void | GetObject (class IObject **ppObject)=0 |
| Gets the pointer to the IUnknown interface of the referenced object. More...
|
|
virtual Atomics::Long | GetNumStrongRefs () const =0 |
| Returns the number of outstanding strong references. More...
|
|
virtual Atomics::Long | GetNumWeakRefs () const =0 |
| Returns the number of outstanding weak references. More...
|
|
Base interface for a reference counter object that stores the number of strong and weak references and the pointer to the object. It is necessary to separate reference counters from the object to support weak pointers.
virtual Atomics::Long Diligent::IReferenceCounters::AddStrongRef |
( |
| ) |
|
|
pure virtual |
Increments the number of strong references by 1.
- Returns
- The number of strong references after incrementing the counter.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter.
virtual Atomics::Long Diligent::IReferenceCounters::AddWeakRef |
( |
| ) |
|
|
pure virtual |
Increments the number of weak references by 1.
- Returns
- The number of weak references after incrementing the counter.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter.
virtual Atomics::Long Diligent::IReferenceCounters::GetNumStrongRefs |
( |
| ) |
const |
|
pure virtual |
Returns the number of outstanding strong references.
- Returns
- The number of strong references.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter. The only reliable value is 0 as the object is destroyed when the last strong reference is released.
virtual Atomics::Long Diligent::IReferenceCounters::GetNumWeakRefs |
( |
| ) |
const |
|
pure virtual |
Returns the number of outstanding weak references.
- Returns
- The number of weak references.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter.
virtual void Diligent::IReferenceCounters::GetObject |
( |
class IObject ** |
ppObject | ) |
|
|
pure virtual |
Gets the pointer to the IUnknown interface of the referenced object.
- Parameters
-
[out] | ppObject | - Memory address where the pointer to the object will be stored. |
virtual Atomics::Long Diligent::IReferenceCounters::ReleaseStrongRef |
( |
| ) |
|
|
pure virtual |
Decrements the number of strong references by 1 and destroys the referenced object when the counter reaches zero. If there are no more weak references, destroys the reference counters object itself.
- Returns
- The number of strong references after decrementing the counter.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter. The only reliable value is 0 as the object is destroyed when the last strong reference is released.
virtual Atomics::Long Diligent::IReferenceCounters::ReleaseWeakRef |
( |
| ) |
|
|
pure virtual |
Decrements the number of weak references by 1. If there are no more strong and weak references, destroys the reference counters object itself.
- Returns
- The number of weak references after decrementing the counter.
- Note
- In a multithreaded environment, the returned number may not be reliable as other threads may simultaneously change the actual value of the counter.