LibreOffice Module vcl (master)  1
Public Member Functions | Private Attributes | List of all members
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire > Class Template Reference

This template handles BitmapAccess the RAII way. More...

#include <scopedbitmapaccess.hxx>

Inheritance diagram for vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >:
[legend]
Collaboration diagram for vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >:
[legend]

Public Member Functions

 ScopedBitmapAccess (Bitmap &rBitmap)
 
 ScopedBitmapAccess (Access *pAccess, Bitmap &rBitmap)
 
 ScopedBitmapAccess ()
 
ScopedBitmapAccessoperator= (ScopedBitmapAccess &&other)
 
 ScopedBitmapAccess (const ScopedBitmapAccess &)=delete
 
ScopedBitmapAccessoperator= (const ScopedBitmapAccess &)=delete
 
 ~ScopedBitmapAccess () COVERITY_NOEXCEPT_FALSE
 
void reset ()
 
bool operator! () const
 
 operator bool () const
 
Access * get ()
 
const Access * get () const
 
Access * operator-> ()
 
const Access * operator-> () const
 
Access & operator* ()
 
const Access & operator* () const
 

Private Attributes

Access * mpAccess
 
BitmapmpBitmap
 

Detailed Description

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
class vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >

This template handles BitmapAccess the RAII way.

Please don't use directly, but through the ready-made typedefs ScopedReadAccess and ScopedWriteAccess in classes Bitmap and AlphaMask.

Use as follows: Bitmap aBitmap; Bitmap::ScopedReadAccess pReadAccess( aBitmap ); pReadAccess->SetPixel()...

Bitmap aBitmap2; BitmapScopedWriteAccess pWriteAccess( bCond ? aBitmap2.AcquireWriteAccess() : 0, aBitmap2 ); if ( pWriteAccess )...

Attention:
for practical reasons, ScopedBitmapAccess stores a reference to the provided bitmap, thus, make sure that the bitmap specified at construction time lives at least as long as the ScopedBitmapAccess.

Definition at line 46 of file scopedbitmapaccess.hxx.

Constructor & Destructor Documentation

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::ScopedBitmapAccess ( Bitmap rBitmap)
inlineexplicit

Definition at line 49 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::ScopedBitmapAccess ( Access *  pAccess,
Bitmap rBitmap 
)
inline

Definition at line 56 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::ScopedBitmapAccess ( )
inline

Definition at line 62 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::ScopedBitmapAccess ( const ScopedBitmapAccess< Access, Bitmap, Acquire > &  )
delete
template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::~ScopedBitmapAccess ( )
inline

Definition at line 82 of file scopedbitmapaccess.hxx.

Member Function Documentation

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
Access* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::get ( )
inline
template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
const Access* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::get ( ) const
inline

Definition at line 104 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator bool ( ) const
inlineexplicit

Definition at line 98 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
bool vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator! ( ) const
inline

Definition at line 97 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
Access& vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator* ( void  )
inline

Definition at line 109 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
const Access& vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator* ( void  ) const
inline

Definition at line 110 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
Access* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator-> ( )
inline

Definition at line 106 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
const Access* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator-> ( ) const
inline

Definition at line 107 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
ScopedBitmapAccess& vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator= ( ScopedBitmapAccess< Access, Bitmap, Acquire > &&  other)
inline

Definition at line 69 of file scopedbitmapaccess.hxx.

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
ScopedBitmapAccess& vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::operator= ( const ScopedBitmapAccess< Access, Bitmap, Acquire > &  )
delete
template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
void vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset ( )
inline

Member Data Documentation

template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
Access* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::mpAccess
private
template<class Access, class Bitmap, Access *(Bitmap::*)() Acquire>
Bitmap* vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::mpBitmap
private

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