LibreOffice Module canvas (master)  1
Public Types | Public Member Functions | Private Attributes | List of all members
canvas::vcltools::VCLObject< Wrappee_ > Class Template Reference

This helper template wraps VCL objects, and protects object deletion with the Solar mutex. More...

#include <vclwrapper.hxx>

Inheritance diagram for canvas::vcltools::VCLObject< Wrappee_ >:
[legend]

Public Types

typedef Wrappee_ Wrappee
 

Public Member Functions

 VCLObject ()
 
 VCLObject (std::unique_ptr< Wrappee > pWrappee)
 
 VCLObject (const VCLObject &rOrig)
 
 VCLObject (VCLObject &&rOrig) noexcept
 
 VCLObject (const Wrappee &rOrig)
 
VCLObjectoperator= (const VCLObject &rhs)
 
VCLObjectoperator= (VCLObject &&rhs) noexcept
 
 ~VCLObject ()
 
Wrappeeoperator-> ()
 
const Wrappeeoperator-> () const
 
Wrappeeoperator* ()
 
const Wrappeeoperator* () const
 
Wrappeeget ()
 
const Wrappeeget () const
 
void swap (VCLObject &rOther)
 

Private Attributes

std::unique_ptr< WrappeempWrappee
 

Detailed Description

template<class Wrappee_>
class canvas::vcltools::VCLObject< Wrappee_ >

This helper template wraps VCL objects, and protects object deletion with the Solar mutex.

All other operations are unprotected, this must be handled by client code.

The reason for this template is the fact that VCL objects hold by value in uno::Reference-handled classes are deleted without having the chance to get inbetween and lock the solar mutex.

This template handles that problem transparently, the only inconvenience is the fact that object member access now has to be performed via operator->, since . is not overloadable.

Otherwise, the template preserves the value semantics of the wrapped object, that is, copy operations are performed not by copying pointers, but by copying the underlying object. This includes constness, i.e. on a const VCLObject, only const methods of the wrapped object can be called. Simply imagine this to be a value object of type "template argument", with the only peculiarity that member/method access is performed by operator-> instead of the non-existing "operator.".

Definition at line 53 of file vclwrapper.hxx.

Member Typedef Documentation

template<class Wrappee_>
typedef Wrappee_ canvas::vcltools::VCLObject< Wrappee_ >::Wrappee

Definition at line 56 of file vclwrapper.hxx.

Constructor & Destructor Documentation

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::VCLObject ( )
inline

Definition at line 58 of file vclwrapper.hxx.

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::VCLObject ( std::unique_ptr< Wrappee pWrappee)
inline

Definition at line 66 of file vclwrapper.hxx.

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::VCLObject ( const VCLObject< Wrappee_ > &  rOrig)
inline

Definition at line 73 of file vclwrapper.hxx.

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::VCLObject ( VCLObject< Wrappee_ > &&  rOrig)
inlinenoexcept

Definition at line 81 of file vclwrapper.hxx.

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::VCLObject ( const Wrappee rOrig)
inline

Definition at line 88 of file vclwrapper.hxx.

template<class Wrappee_>
canvas::vcltools::VCLObject< Wrappee_ >::~VCLObject ( )
inline

Definition at line 120 of file vclwrapper.hxx.

Member Function Documentation

template<class Wrappee_>
Wrappee& canvas::vcltools::VCLObject< Wrappee_ >::get ( )
inline

Definition at line 135 of file vclwrapper.hxx.

template<class Wrappee_>
const Wrappee& canvas::vcltools::VCLObject< Wrappee_ >::get ( ) const
inline

Definition at line 136 of file vclwrapper.hxx.

template<class Wrappee_>
Wrappee& canvas::vcltools::VCLObject< Wrappee_ >::operator* ( )
inline

Definition at line 132 of file vclwrapper.hxx.

template<class Wrappee_>
const Wrappee& canvas::vcltools::VCLObject< Wrappee_ >::operator* ( ) const
inline

Definition at line 133 of file vclwrapper.hxx.

template<class Wrappee_>
Wrappee* canvas::vcltools::VCLObject< Wrappee_ >::operator-> ( )
inline

Definition at line 129 of file vclwrapper.hxx.

template<class Wrappee_>
const Wrappee* canvas::vcltools::VCLObject< Wrappee_ >::operator-> ( ) const
inline

Definition at line 130 of file vclwrapper.hxx.

template<class Wrappee_>
VCLObject& canvas::vcltools::VCLObject< Wrappee_ >::operator= ( const VCLObject< Wrappee_ > &  rhs)
inline

Definition at line 95 of file vclwrapper.hxx.

template<class Wrappee_>
VCLObject& canvas::vcltools::VCLObject< Wrappee_ >::operator= ( VCLObject< Wrappee_ > &&  rhs)
inlinenoexcept

Definition at line 113 of file vclwrapper.hxx.

template<class Wrappee_>
void canvas::vcltools::VCLObject< Wrappee_ >::swap ( VCLObject< Wrappee_ > &  rOther)
inline

Definition at line 138 of file vclwrapper.hxx.

Member Data Documentation

template<class Wrappee_>
std::unique_ptr<Wrappee> canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee
private

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