Adding wrapper for CFArray, updating other wrappers

This commit is contained in:
Stefan Csomor
2018-07-30 16:32:12 +02:00
parent a02efd1fc7
commit 4bda27c96c
9 changed files with 332 additions and 141 deletions

View File

@@ -165,6 +165,19 @@ public:
: m_ptr(NULL)
{}
/*! @method wxCFRef
@abstract Assumes ownership of p and creates a reference to it.
@param p The raw core foundation reference to assume ownership of. May be NULL.
@discussion Like shared_ptr, it is assumed that the caller has a strong reference to p and intends
to transfer ownership of that reference to this ref holder. If the object comes from
a Create or Copy method then this is the correct behaviour. If the object comes from
a Get method then you must CFRetain it yourself before passing it to this constructor.
A handy way to do this is to use the non-member wxCFRefFromGet factory funcion.
*/
wxCFRef(refType p) : m_ptr(p)
{
}
/*! @method wxCFRef
@abstract Assumes ownership of p and creates a reference to it.
@templatefield otherType Any type.
@@ -177,6 +190,7 @@ public:
This method is templated and takes an otherType *p. This prevents implicit conversion
using an operator refType() in a different ref-holding class type.
*/
template <class otherType>
explicit wxCFRef(otherType *p)
: m_ptr(p) // Implicit conversion from otherType* to refType should occur.