20#ifndef INCLUDED_VCL_PTR_HXX
21#define INCLUDED_VCL_PTR_HXX
45{
return std::is_base_of<VclReferenceBase, T>::value; }
56template <
class reference_type>
60 vcl::detail::isIncompleteOrDerivedFromVclReferenceBase<reference_type>(
62 "template argument type must be derived from VclReferenceBase");
81 VclPtr (reference_type * pBody, __sal_NoAcquire)
93 template<
class derived_type >
96 typename std::enable_if<
97 std::is_base_of<reference_type, derived_type>::value,
int>::type
103#if defined(DBG_UTIL) && !defined(_WIN32)
110 &&
"someone forgot to call dispose()");
143 reference_type *
get()
const
148 void set(reference_type *pBody)
164 template<
typename derived_type>
165 typename std::enable_if<
166 std::is_base_of<reference_type, derived_type>::value,
180 operator reference_type * ()
const
185 explicit operator bool ()
const
219template<
typename T1,
typename T2>
221 return p1.
get() == p2.
get();
226 return p1.
get() == p2;
230 return p1.
get() == p2;
235 return p1 == p2.
get();
239 return p1 == p2.
get();
242template<
typename T1,
typename T2>
275template <
class reference_type>
291template <
class reference_type>
298 :
VclPtr<reference_type>()
304 :
VclPtr<reference_type>(pBody)
310 :
VclPtr<reference_type>(handle)
318 if (pBody != this->
get()) {
341 template<
class derived_type >
344 typename std::enable_if<
345 std::is_base_of<reference_type, derived_type>::value,
int>::type
347 :
VclPtr<reference_type>( rRef )
357 template<
typename derived_type>
358 typename std::enable_if<
359 std::is_base_of<reference_type, derived_type>::value,
386 void reset(reference_type *pBody) =
delete;
390 :
VclPtr<reference_type>(pBody, SAL_NO_ACQUIRE)
405#pragma warning(disable: 4521)
407template <
class reference_type>
A construction helper for ScopedVclPtr.
ScopedVclPtrInstance(ScopedVclPtrInstance &)=delete
ScopedVclPtrInstance(ScopedVclPtrInstance const &)=delete
static ScopedVclPtrInstance< reference_type > Create(Arg &&...)=delete
Override and disallow this, to prevent people accidentally calling it and actually getting VclPtr::Cr...
ScopedVclPtrInstance(Arg &&... arg)
static ScopedVclPtr< reference_type > Create(Arg &&...)=delete
Override and disallow this, to prevent people accidentally calling it and actually getting VclPtr::Cr...
ScopedVclPtr(const VclPtr< reference_type > &handle)
Copy constructor...
ScopedVclPtr< reference_type > & operator=(reference_type *pBody)
Assignment that releases the last reference.
ScopedVclPtr(reference_type *pBody, __sal_NoAcquire)
void reset(reference_type *pBody)=delete
void disposeAndReset(reference_type *pBody)
Assignment that releases the last reference.
ScopedVclPtr(reference_type *pBody)
Constructor.
ScopedVclPtr(const ScopedVclPtr< reference_type > &)=delete
ScopedVclPtr()
Constructor...
ScopedVclPtr(const VclPtr< derived_type > &rRef, typename std::enable_if< std::is_base_of< reference_type, derived_type >::value, int >::type=0)
Up-casting conversion constructor: Copies interface reference.
A construction helper for a temporary VclPtr.
static VclPtrInstance< reference_type > Create(Arg &&...)=delete
Override and disallow this, to prevent people accidentally calling it and actually getting VclPtr::Cr...
VclPtrInstance(Arg &&... arg)
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
VclPtr(VclPtr const &)=default
void set(reference_type *pBody)
VclPtr & operator=(VclPtr const &)=default
VclPtr(reference_type *pBody, __sal_NoAcquire)
Constructor... that doesn't take a ref.
void reset(reference_type *pBody)
VclPtr(reference_type *pBody)
Constructor...
::rtl::Reference< reference_type > m_rInnerRef
VclPtr(VclPtr &&)=default
reference_type * get() const
Get the body.
VclPtr(const VclPtr< derived_type > &rRef, typename std::enable_if< std::is_base_of< reference_type, derived_type >::value, int >::type=0)
Up-casting conversion constructor: Copies interface reference.
bool operator<(const VclPtr< reference_type > &handle) const
Needed to place VclPtr's into STL collection.
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
constexpr bool isIncompleteOrDerivedFromVclReferenceBase(...)
bool operator==(VclPtr< T1 > const &p1, VclPtr< T2 > const &p2)
bool operator!=(VclPtr< T1 > const &p1, VclPtr< T2 > const &p2)