LibreOffice Module canvas (master) 1
|
This helper template wraps VCL objects, and protects object deletion with the Solar mutex. More...
#include <vclwrapper.hxx>
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) | |
VCLObject & | operator= (const VCLObject &rhs) |
VCLObject & | operator= (VCLObject &&rhs) noexcept |
~VCLObject () | |
Wrappee * | operator-> () |
const Wrappee * | operator-> () const |
Wrappee & | operator* () |
const Wrappee & | operator* () const |
Wrappee & | get () |
const Wrappee & | get () const |
void | swap (VCLObject &rOther) |
Private Attributes | |
std::unique_ptr< Wrappee > | mpWrappee |
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.
typedef Wrappee_ canvas::vcltools::VCLObject< Wrappee_ >::Wrappee |
Definition at line 56 of file vclwrapper.hxx.
|
inline |
Definition at line 58 of file vclwrapper.hxx.
|
inline |
Definition at line 66 of file vclwrapper.hxx.
|
inline |
Definition at line 73 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inlinenoexcept |
Definition at line 81 of file vclwrapper.hxx.
|
inline |
Definition at line 88 of file vclwrapper.hxx.
|
inline |
Definition at line 120 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 135 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 136 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 132 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 133 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 129 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 130 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 95 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inlinenoexcept |
Definition at line 113 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
inline |
Definition at line 138 of file vclwrapper.hxx.
References canvas::vcltools::VCLObject< Wrappee_ >::mpWrappee.
|
private |
Definition at line 145 of file vclwrapper.hxx.
Referenced by canvas::vcltools::VCLObject< Wrappee_ >::get(), canvas::vcltools::VCLObject< Wrappee_ >::operator*(), canvas::vcltools::VCLObject< Wrappee_ >::operator->(), canvas::vcltools::VCLObject< Wrappee_ >::operator=(), canvas::vcltools::VCLObject< Wrappee_ >::swap(), canvas::vcltools::VCLObject< Wrappee_ >::VCLObject(), and canvas::vcltools::VCLObject< Wrappee_ >::~VCLObject().