StrongACOWRefHandler Class Reference

#include <baseref.h>

Inheritance diagram for StrongACOWRefHandler:

Detailed Description

StrongACOWRefHandler has to be used as template argument for BaseRef to obtain a reference to objects which support reference counting, and which shall have always-copy-on-write semantics. This is similar to the copy-on-write semantics of StrongCOWRefHandler, but it also makes a copy if the reference to the pointee is exclusive. If the allocation of a copy fails the reference will be set to null.

Static Public Member Functions

template<typename R >
static MAXON_ATTRIBUTE_NO_INLINE ResultRef< typename std::remove_const< typename R::ReferencedType >::typeMakeWritable (R &ref, Bool resetOnError)
 
- Static Public Member Functions inherited from StrongRefHandler
template<typename T >
static void InitialReference (const T *o)
 
template<typename T >
static void AddReference (const T *o)
 
template<typename T >
static MAXON_ATTRIBUTE_NO_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 StrongReferenceCounterGetReferenceCounter (const T *o)
 
template<typename R >
static ResultRef< typename R::ReferencedType > MakeWritable (R &ref, Bool resetOnError)
 
template<typename T >
static void ChangeTarget (T *&o, T *newTarget)
 
template<typename T >
static void ChangeTarget (T *&o, ResultMemT< T * > newTarget)
 
template<typename T >
static void MoveTarget (T *&srcReference, T *&dstReference)
 

Static Public Attributes

static constexpr VALUEKIND KIND
 
- Static Public Attributes inherited from StrongRefHandler
static constexpr VALUEKIND KIND
 

Member Function Documentation

◆ MakeWritable()

static MAXON_ATTRIBUTE_NO_INLINE ResultRef<typename std::remove_const<typename R::ReferencedType>::type> MakeWritable ( R &  ref,
Bool  resetOnError 
)
static
Parameters
[in]resetOnErrorIf true (the default), the reference will be reset when the copy fails. If false, the reference will stay the same, but the function returns nullptr.

Member Data Documentation

◆ KIND

constexpr VALUEKIND KIND
staticconstexpr