#include <baseref.h>
StrongRefHandler has to be used as template argument for BaseRef to obtain a reference to objects which support reference counting. Whenever the pointer of such a BaseRef is set, the reference count of the pointee is increased by invocation of AddReference() on the pointee. If a pointer is cleared, the reference count of the pointee is decreased by means of RemoveReference(). If the reference count reaches zero, the pointee releases itself.
Classes | |
struct | HasAddReference< FlexibleArray< T, COUNT > > |
struct | HasRemoveReference< DescTranslation > |
struct | HasRemoveReference< FlexibleArray< T, COUNT > > |
Static Public Member Functions | |
template<typename T > | |
static void | InitialReference (const T *o) |
template<typename T > | |
static void | AddReference (const T *o) |
template<typename T > | |
static MAXON_ATTRIBUTE_FORCE_INLINE void | RemoveReference (const T *o) |
template<typename T > | |
static void | AddWeakReference (const T *o, WeakRefBase &weakRef) |
template<typename T > | |
static Bool | CreateStrongReference (const T *o) |
template<typename T > | |
static StrongReferenceCounter & | GetReferenceCounter (const T *o) |
template<typename R > | |
static ResultRef< typename R::ReferencedType > | MakeWritable (R &ref, Bool resetOnError) |
Static Public Attributes | |
static constexpr VALUEKIND | KIND |
Private Member Functions | |
MAXON_MEMBERFUNCTION_DETECTOR (InitialReference) | |
MAXON_MEMBERFUNCTION_DETECTOR (AddReference) | |
MAXON_MEMBERFUNCTION_DETECTOR (RemoveReference) | |
|
private |
|
private |
|
private |
|
static |
Sets the initial reference to a newly allocated object (slightly more efficient than AddReference).
[in] | o | Pointer to the referenced object, must not be nullptr. |
|
static |
Adds a reference to the referenced object.
[in] | o | Pointer to the referenced object, must not be nullptr. |
|
static |
Removes a reference to the referenced object.
[in] | o | Pointer to the referenced object, must not be nullptr. |
|
static |
|
static |
Tries to add a strong reference. If the object is already being released this will return false.
[in] | o | Weakly referenced object (might be nullptr). |
|
static |
|
staticconstexpr |