NSStrongRef< T > Class Template Reference

#include <mac_cfhelpers.h>

Inheritance diagram for NSStrongRef< T >:

Detailed Description

template<typename T>
class maxon::NSStrongRef< T >

Reference for a ObjC object which was created (and hence implicitely retained). The object will released when the NSStrongRef will be destructed.

Public Member Functions

 NSStrongRef ()=default
 
MAXON_IMPLICIT NSStrongRef (T *o)
 
 NSStrongRef (const NSStrongRef &src)=default
 
 NSStrongRef (NSStrongRef &&src)=default
 
NSStrongRefoperator= (T *src)
 
NSStrongRefoperator= (const NSStrongRef &src)=default
 
NSStrongRefoperator= (NSStrongRef &&src)=default
 
NSStrongRefoperator= (std::nullptr_t src)
 
- Public Member Functions inherited from BaseRef< T, NSCreatedPointerHandler >
 BaseRef ()
 
MAXON_IMPLICIT BaseRef (std::nullptr_t)=delete
 
MAXON_IMPLICIT BaseRef (T *o)
 
 BaseRef (ForwardResultPtr< PTR > o)
 
 BaseRef (ResultPtr< T > o, Int)
 
 BaseRef (const BaseRef &src)
 
MAXON_IMPLICIT BaseRef (const REF &src)
 
MAXON_IMPLICIT BaseRef (REF &src)
 
 BaseRef (BaseRef &&src)
 
MAXON_IMPLICIT BaseRef (REF &&src)
 
T * GetPointer ()
 
ConstReferencedTypeGetPointer () const
 
T * operator-> ()
 
ConstReferencedTypeoperator-> () const
 
std::conditional< std::is_void< T >::value, DeleteReturnType01, T >::typeoperator* ()
 
std::conditional< std::is_void< ConstReferencedType >::value, DeleteReturnType01, T >::typeoperator* () const
 
 operator T* ()
 
 operator ConstReferencedType * () const
 
 operator Bool () const
 
 operator Bool ()
 
const std::conditional< std::is_void< T >::value, DeleteReturnType01, T >::typeoperator[] (Int) const=delete
 
ResultRef< typename std::remove_const< T >::typeMakeWritable (Bool resetOnError=true)
 
ResultRef< typename std::remove_const< T >::typeMakeWritableDontCopy ()
 
Bool HasMultipleReferences () const
 
std::conditional< std::is_void< T >::value, DeleteReturnType01, T >::typeGetOrDefault () const
 
BaseRefoperator= (T *src)
 
BaseRefoperator= (std::nullptr_t src)
 
BaseRefoperator= (const BaseRef &src)
 
BaseRefoperator= (const REF &src)
 
BaseRefoperator= (REF &src)
 
BaseRefoperator= (BaseRef &&src)
 
BaseRefoperator= (REF &&src)
 
 ~BaseRef ()
 
Bool operator== (const BaseRef &b) const
 
Bool operator== (const T *b) const
 
Bool operator== (typename std::remove_const< T >::type *b) const
 
Bool operator== (std::nullptr_t) const
 
Bool operator!= (const BaseRef &b) const
 
Bool operator!= (const T *b) const
 
Bool operator!= (typename std::remove_const< T >::type *b) const
 
Bool operator!= (std::nullptr_t) const
 
Bool operator< (const BaseRef &b) const
 
 MAXON_OPERATOR_INEQUALITY (BaseRef)
 
HashInt GetHashCode () const
 
UniqueHash GetUniqueHashCode () const
 
std::conditional< Bool(HANDLER::KIND &VALUEKIND::COW_MASK), typename std::remove_const< T >::type, T >::typeDisconnect ()
 
void PrivateSetTarget (ResultPtr< T > src)
 
void PrivateSetPointer (T *ptr)
 

Private Types

using Super = BaseRef< T, NSCreatedPointerHandler >
 

Additional Inherited Members

- Public Types inherited from BaseRef< T, NSCreatedPointerHandler >
using ReferencedType = T
 
using ConstReferencedType = typename ConstIf< T, Bool(HANDLER::KIND &VALUEKIND::DEEP_CONSTNESS)>::type
 
using DirectlyReferencedType = T
 
using SelfType = BaseRef< T, NSCreatedPointerHandler >
 
using IsGenericBaseOf = std::true_type
 
using Handler = NSCreatedPointerHandler
 
using RefCompareType = RefCompare< MAXON_IS_COW_KIND(HANDLER::KIND), IsInterfaceType< T >::value >
 
- Static Public Member Functions inherited from BaseRef< T, NSCreatedPointerHandler >
static void PrivateLookupFn ()
 
static std::false_type GenericVarianceCheck (const void *)
 
static MAXON_ATTRIBUTE_FORCE_INLINE ResultMemT< BaseRefCreate (ARGS &&... args)
 
static const BaseRefDefaultValueRef ()
 
static std::conditional< Bool(HANDLER::KIND &VALUEKIND::UNIQUE_REFERENCE), BaseRef, const BaseRef & >::type DefaultValue ()
 
- Public Attributes inherited from BaseRef< T, NSCreatedPointerHandler >
T * _object
 
const void * _impl
 
- Static Public Attributes inherited from BaseRef< T, NSCreatedPointerHandler >
static constexpr Bool DIRECT_REF
 
- Protected Attributes inherited from BaseRef< T, NSCreatedPointerHandler >
union {
   T *   _object
 
   const void *   _impl
 
}; 
 

Member Typedef Documentation

◆ Super

using Super = BaseRef<T, NSCreatedPointerHandler>
private

Constructor & Destructor Documentation

◆ NSStrongRef() [1/4]

NSStrongRef ( )
default

◆ NSStrongRef() [2/4]

Assignment of an already retained object (returned by a alloc, new or copy method). Objects which are returned by other methods have to be retained before assigning them to a NSStrongRef. See https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-BAJHFBGH.

◆ NSStrongRef() [3/4]

NSStrongRef ( const NSStrongRef< T > &  src)
default

◆ NSStrongRef() [4/4]

NSStrongRef ( NSStrongRef< T > &&  src)
default

Member Function Documentation

◆ operator=() [1/4]

NSStrongRef& operator= ( T *  src)

Assignment of an already retained object (returned by a alloc, new or copy method). Objects which are returned by other methods have to be retained before assigning them to a NSStrongRef. See https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-BAJHFBGH.

◆ operator=() [2/4]

NSStrongRef& operator= ( const NSStrongRef< T > &  src)
default

◆ operator=() [3/4]

NSStrongRef& operator= ( NSStrongRef< T > &&  src)
default

◆ operator=() [4/4]

NSStrongRef& operator= ( std::nullptr_t  src)