nx_cloud_storage_sdk
1.0
Cloud Storage SDK
|
#include <ref_countable.h>
Public Member Functions | |
RefCountableHolder (const RefCountableHolder &)=delete | |
RefCountableHolder & | operator= (const RefCountableHolder &)=delete |
RefCountableHolder (RefCountableHolder &&)=delete | |
RefCountableHolder & | operator= (RefCountableHolder &&)=delete |
RefCountableHolder (const IRefCountable *refCountable) | |
RefCountableHolder (const RefCountableHolder *delegate) | |
int | addRef () const |
int | releaseRef () const |
int | refCount () const |
Not recommended to be used directly - use RefCountable, unless there is some special case.
Implements IRefCountable reference counting. Can delegate reference counting to another RefCountableHolder instance.
Does not inherit IRefCountable because it would need to be a virtual base class.
The instance is supposed to be nested into a ref-countable object, explicitly calling addRef() and releaseRef() from the respective methods of that ref-countable class.
|
inline |
Takes ownership of the given object - it will be deleted when the reference counter reaches zero.
NOTE: After creation, the reference counter is 1.
|
inline |
Delegates reference counting to another object. Does not change the reference counter.
|
inline |
NOTE: Deletes the owned object if the reference counter reaches zero.