StrongCOWRefHandler has to be used as template argument for BaseRef to obtain a reference to objects which support reference counting, and which shall have copy-on-write semantics. It shares the basic behavior of StrongRefHandler, but if a modification of the object is to be made through the reference, or if BaseRef::MakeWritable() is invoked, it is checked by invocation of GetReferenceCount() on the object if the reference is exclusive or not. If so, the object can be modified directly, otherwise a copy is made and set as new pointee of the reference. This way the other references to the original object aren't affected by the modification. If the allocation of a copy fails the reference will be set to null.
|
| template<typename R > |
| static MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< typename std::remove_const< typename R::ReferencedType >::type > | MakeWritable (R &ref, Bool resetOnError) |
| |
| template<typename R > |
| static MAXON_ATTRIBUTE_NO_INLINE ResultRef< typename std::remove_const< typename R::ReferencedType >::type > | PrivateMakeWritableDontCopy (R &ref) |
| |
| template<typename R > |
| static MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< typename std::remove_const< typename R::ReferencedType >::type > | MakeWritableDontCopy (R &ref) |
| |
| template<typename R , typename CREATE , typename COPY > |
| static MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< typename std::remove_const< typename R::ReferencedType >::type > | MakeWritable (R &ref, CREATE &&create, COPY &©) |
| |
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_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) |
| |
| 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) |
| |