LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ScopedVclPtr< reference_type > Class Template Reference

#include <vclptr.hxx>

Inheritance diagram for ScopedVclPtr< reference_type >:
[legend]
Collaboration diagram for ScopedVclPtr< reference_type >:
[legend]

Public Member Functions

 ScopedVclPtr ()
 Constructor... More...
 
 ScopedVclPtr (reference_type *pBody)
 Constructor. More...
 
 ScopedVclPtr (const VclPtr< reference_type > &handle)
 Copy constructor... More...
 
void disposeAndReset (reference_type *pBody)
 Assignment that releases the last reference. More...
 
ScopedVclPtr< reference_type > & operator= (reference_type *pBody)
 Assignment that releases the last reference. More...
 
template<class derived_type >
 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. More...
 
template<typename derived_type >
std::enable_if< std::is_base_of< reference_type, derived_type >::value, ScopedVclPtr & >::type operator= (VclPtr< derived_type > const &rRef)
 Up-casting assignment operator. More...
 
 ~ScopedVclPtr ()
 
- Public Member Functions inherited from VclPtr< reference_type >
 VclPtr ()
 Constructor... More...
 
 VclPtr (reference_type *pBody)
 Constructor... More...
 
 VclPtr (reference_type *pBody, __sal_NoAcquire)
 Constructor... that doesn't take a ref. More...
 
template<class derived_type >
 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. More...
 
 ~VclPtr ()
 
 VclPtr (VclPtr const &)=default
 
 VclPtr (VclPtr &&)=default
 
VclPtroperator= (VclPtr const &)=default
 
VclPtroperator= (VclPtr &&)=default
 
reference_type * operator-> () const
 Probably most common used: handle->someBodyOp(). More...
 
reference_type * get () const
 Get the body. More...
 
void set (reference_type *pBody)
 
void reset (reference_type *pBody)
 
template<typename derived_type >
std::enable_if< std::is_base_of< reference_type, derived_type >::value, VclPtr & >::type operator= (VclPtr< derived_type > const &rRef)
 Up-casting copy assignment operator. More...
 
VclPtroperator= (reference_type *pBody)
 
 operator reference_type * () const
 
 operator bool () const
 
void clear ()
 
void reset ()
 
void disposeAndClear ()
 
bool operator< (const VclPtr< reference_type > &handle) const
 Needed to place VclPtr's into STL collection. More...
 

Static Public Member Functions

template<typename... Arg>
static ScopedVclPtr< reference_type > Create (Arg &&...)=delete
 Override and disallow this, to prevent people accidentally calling it and actually getting VclPtr::Create and getting a naked VclPtr<> instance. More...
 
- Static Public Member Functions inherited from VclPtr< reference_type >
template<typename... Arg>
static VclPtr< reference_type > Create (Arg &&... arg)
 A construction helper for VclPtr. More...
 

Protected Member Functions

 ScopedVclPtr (reference_type *pBody, __sal_NoAcquire)
 

Private Member Functions

 ScopedVclPtr (const ScopedVclPtr< reference_type > &)=delete
 
ScopedVclPtr< reference_type > & operator= (const ScopedVclPtr< reference_type > &)=delete
 
void reset ()=delete
 
void reset (reference_type *pBody)=delete
 

Detailed Description

template<class reference_type>
class ScopedVclPtr< reference_type >

Definition at line 292 of file vclptr.hxx.

Constructor & Destructor Documentation

◆ ScopedVclPtr() [1/6]

template<class reference_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( )
inline

Constructor...

Definition at line 297 of file vclptr.hxx.

◆ ScopedVclPtr() [2/6]

template<class reference_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( reference_type *  pBody)
inline

Constructor.

Definition at line 303 of file vclptr.hxx.

◆ ScopedVclPtr() [3/6]

template<class reference_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( const VclPtr< reference_type > &  handle)
inline

Copy constructor...

Definition at line 309 of file vclptr.hxx.

◆ ScopedVclPtr() [4/6]

template<class reference_type >
template<class derived_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( const VclPtr< derived_type > &  rRef,
typename std::enable_if< std::is_base_of< reference_type, derived_type >::value, int >::type  = 0 
)
inline

Up-casting conversion constructor: Copies interface reference.

Does not work for up-casts to ambiguous bases. For the special case of up-casting to Reference< XInterface >, see the corresponding conversion operator.

Parameters
rRefanother reference

Definition at line 342 of file vclptr.hxx.

◆ ~ScopedVclPtr()

template<class reference_type >
ScopedVclPtr< reference_type >::~ScopedVclPtr ( )
inline

Definition at line 373 of file vclptr.hxx.

References VclPtr< reference_type >::disposeAndClear().

◆ ScopedVclPtr() [5/6]

template<class reference_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( const ScopedVclPtr< reference_type > &  )
privatedelete

◆ ScopedVclPtr() [6/6]

template<class reference_type >
ScopedVclPtr< reference_type >::ScopedVclPtr ( reference_type *  pBody,
__sal_NoAcquire   
)
inlineprotected

Definition at line 389 of file vclptr.hxx.

Member Function Documentation

◆ Create()

template<class reference_type >
template<typename... Arg>
static ScopedVclPtr< reference_type > ScopedVclPtr< reference_type >::Create ( Arg &&  ...)
staticdelete

Override and disallow this, to prevent people accidentally calling it and actually getting VclPtr::Create and getting a naked VclPtr<> instance.

References Arg.

◆ disposeAndReset()

template<class reference_type >
void ScopedVclPtr< reference_type >::disposeAndReset ( reference_type *  pBody)
inline

◆ operator=() [1/3]

template<class reference_type >
ScopedVclPtr< reference_type > & ScopedVclPtr< reference_type >::operator= ( const ScopedVclPtr< reference_type > &  )
privatedelete

◆ operator=() [2/3]

template<class reference_type >
ScopedVclPtr< reference_type > & ScopedVclPtr< reference_type >::operator= ( reference_type *  pBody)
inline

Assignment that releases the last reference.

Definition at line 327 of file vclptr.hxx.

References ScopedVclPtr< reference_type >::disposeAndReset().

◆ operator=() [3/3]

template<class reference_type >
template<typename derived_type >
std::enable_if< std::is_base_of< reference_type, derived_type >::value, ScopedVclPtr & >::type ScopedVclPtr< reference_type >::operator= ( VclPtr< derived_type > const &  rRef)
inline

Up-casting assignment operator.

Does not work for up-casts to ambiguous bases.

Parameters
rRefanother VclPtr

Definition at line 361 of file vclptr.hxx.

References ScopedVclPtr< reference_type >::disposeAndReset(), and VclPtr< reference_type >::get().

◆ reset() [1/2]

template<class reference_type >
void ScopedVclPtr< reference_type >::reset ( )
privatedelete

◆ reset() [2/2]

template<class reference_type >
void ScopedVclPtr< reference_type >::reset ( reference_type *  pBody)
privatedelete

The documentation for this class was generated from the following file: