CFStrongRef< REF > Class Template Reference

#include <mac_cfhelpers.h>

Inheritance diagram for CFStrongRef< REF >:

Detailed Description

template<typename REF>
class maxon::CFStrongRef< REF >

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

Public Member Functions

 CFStrongRef ()=default
 
MAXON_IMPLICIT CFStrongRef (T *o)
 
 CFStrongRef (const CFStrongRef &src)=default
 
 CFStrongRef (CFStrongRef &&src)=default
 
CFStrongRefoperator= (T *src)
 
CFStrongRefoperator= (const CFStrongRef &src)=default
 
CFStrongRefoperator= (CFStrongRef &&src)=default
 
CFStrongRefoperator= (std::nullptr_t src)
 
REF * GetAddressOf ()
 
- Public Member Functions inherited from BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
 BaseRef ()
 
MAXON_IMPLICIT BaseRef (std::nullptr_t)=delete
 
MAXON_IMPLICIT BaseRef (std::remove_pointer< REF >::type *o)
 
 BaseRef (ForwardResultPtr< PTR > o)
 
 BaseRef (ResultPtr< std::remove_pointer< REF >::type > 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)
 
std::remove_pointer< REF >::typeGetPointer ()
 
ConstReferencedTypeGetPointer () const
 
std::remove_pointer< REF >::typeoperator-> ()
 
ConstReferencedTypeoperator-> () const
 
std::conditional< std::is_void< std::remove_pointer< REF >::type >::value, DeleteReturnType01, std::remove_pointer< REF >::type >::typeoperator* ()
 
std::conditional< std::is_void< ConstReferencedType >::value, DeleteReturnType01, std::remove_pointer< REF >::type >::typeoperator* () const
 
 operator std::remove_pointer< REF >::type * ()
 
 operator ConstReferencedType * () const
 
 operator Bool () const
 
 operator Bool ()
 
const std::conditional< std::is_void< std::remove_pointer< REF >::type >::value, DeleteReturnType01, std::remove_pointer< REF >::type >::typeoperator[] (Int) const=delete
 
ResultRef< typename std::remove_const< std::remove_pointer< REF >::type >::typeMakeWritable (Bool resetOnError=true)
 
ResultRef< typename std::remove_const< std::remove_pointer< REF >::type >::typeMakeWritableDontCopy ()
 
Bool HasMultipleReferences () const
 
std::conditional< std::is_void< std::remove_pointer< REF >::type >::value, DeleteReturnType01, std::remove_pointer< REF >::type >::typeGetOrDefault () const
 
BaseRefoperator= (std::remove_pointer< REF >::type *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 std::remove_pointer< REF >::type *b) const
 
Bool operator== (typename std::remove_const< std::remove_pointer< REF >::type >::type *b) const
 
Bool operator== (std::nullptr_t) const
 
Bool operator!= (const BaseRef &b) const
 
Bool operator!= (const std::remove_pointer< REF >::type *b) const
 
Bool operator!= (typename std::remove_const< std::remove_pointer< REF >::type >::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< std::remove_pointer< REF >::type >::type, std::remove_pointer< REF >::type >::typeDisconnect ()
 
void PrivateSetTarget (ResultPtr< std::remove_pointer< REF >::type > src)
 
void PrivateSetPointer (std::remove_pointer< REF >::type *ptr)
 

Private Types

using T = typename std::remove_pointer< REF >::type
 
using Super = BaseRef< T, CoreFoundationCreatedPointerHandler >
 

Additional Inherited Members

- Public Types inherited from BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
using ReferencedType = std::remove_pointer< REF >::type
 
using ConstReferencedType = typename ConstIf< std::remove_pointer< REF >::type, Bool(HANDLER::KIND &VALUEKIND::DEEP_CONSTNESS)>::type
 
using DirectlyReferencedType = std::remove_pointer< REF >::type
 
using SelfType = BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
 
using IsGenericBaseOf = std::true_type
 
using Handler = CoreFoundationCreatedPointerHandler
 
using RefCompareType = RefCompare< MAXON_IS_COW_KIND(HANDLER::KIND), IsInterfaceType< std::remove_pointer< REF >::type >::value >
 
- Static Public Member Functions inherited from BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
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< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
std::remove_pointer< REF >::type_object
 
const void * _impl
 
- Static Public Attributes inherited from BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
static constexpr Bool DIRECT_REF
 
- Protected Attributes inherited from BaseRef< std::remove_pointer< REF >::type, CoreFoundationCreatedPointerHandler >
union {
   T *   _object
 
   const void *   _impl
 
}; 
 

Member Typedef Documentation

◆ T

using T = typename std::remove_pointer<REF>::type
private

◆ Super

Constructor & Destructor Documentation

◆ CFStrongRef() [1/4]

CFStrongRef ( )
default

◆ CFStrongRef() [2/4]

Assignment of an already retained object (returned by a create or copy method). Objects which are returned by other methods have to be retained before assigning them to a CFStrongRef. See https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-CJBEJBHH

◆ CFStrongRef() [3/4]

CFStrongRef ( const CFStrongRef< REF > &  src)
default

◆ CFStrongRef() [4/4]

CFStrongRef ( CFStrongRef< REF > &&  src)
default

Member Function Documentation

◆ operator=() [1/4]

CFStrongRef& operator= ( T src)

Assignment of an already retained object (returned by a create or copy method). Objects which are returned by other methods have to be retained before assigning them to a CFStrongRef. See https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-CJBEJBHH

◆ operator=() [2/4]

CFStrongRef& operator= ( const CFStrongRef< REF > &  src)
default

◆ operator=() [3/4]

CFStrongRef& operator= ( CFStrongRef< REF > &&  src)
default

◆ operator=() [4/4]

CFStrongRef& operator= ( std::nullptr_t  src)

◆ GetAddressOf()

REF* GetAddressOf ( )

Returns the address of the REF. This is often used by CF methods which return the retained reference of a copy.

Returns
Address of REF (equivalent to this).