+ /*! @method get
+ @abstract Explicit conversion to the underlying pointer type
+ @discussion Allows the caller to explicitly get the underlying pointer.
+ */
+ refType get() const
+ { return m_ptr; }
+
+ /*! @method operator refType
+ @abstract Implicit conversion to the underlying pointer type
+ @discussion Allows the ref to be used in CF function calls.
+ */
+ operator refType() const
+ { return m_ptr; }
+
+protected:
+ /*! @method wxCFWeakRef
+ @abstract Constructs a weak reference to the raw pointer
+ @templatefield otherType Any type.
+ @param p The raw pointer to assume ownership of. May be NULL.
+ @discussion This method is private so that the friend static_cfref_cast can use it
+ */
+ template <class otherType>
+ explicit wxCFWeakRef(otherType *p)
+ : m_ptr(p) // Implicit conversion from otherType* to refType should occur.
+ {}
+
+ /*! @var m_ptr The raw pointer.
+ */
+ refType m_ptr;
+};
+
+/*! @class wxCFRef
+ @templatefield refType The CF reference type (e.g. CFStringRef, CFRunLoopRef, etc.)
+ It should already be a pointer. This is different from
+ shared_ptr where the template parameter is the pointee type.
+ @discussion Properly retains/releases reference to CoreFoundation objects
+*/
+template <class refType>
+class wxCFRef
+{