cairomm 1.18.0
Public Member Functions | List of all members
Cairo::Device::Lock Class Reference

A convenience class for acquiring a Device object in an exception-safe manner. More...

#include <cairomm/device.h>

Public Member Functions

 Lock (const RefPtr< Device > &device)
 Create a new Device lock for device.
 
 Lock (const Lock &other)
 
 ~Lock ()
 

Detailed Description

A convenience class for acquiring a Device object in an exception-safe manner.

The device is automatically acquired when a Lock object is created and released when the Lock object is destroyed. For example:

void
{
// Ensure the device is properly reset
device->flush();
// Do the custom operations on the device here.
// But do not call any Cairo functions that might acquire devices.
} // device is automatically released at the end of the function scope
void lock(_L1 &__l1, _L2 &__l2, _L3 &... __l3)
A convenience class for acquiring a Device object in an exception-safe manner.
Definition device.h:78
RefPtr< T_CppObject > make_refptr_for_instance(T_CppObject *object)
Create a RefPtr<> to an instance of any reference-counted class whose destructor is noexcept (the def...
Definition refptr.h:56

Constructor & Destructor Documentation

◆ Lock() [1/2]

Cairo::Device::Lock::Lock ( const RefPtr< Device > &  device)

Create a new Device lock for device.

◆ Lock() [2/2]

Cairo::Device::Lock::Lock ( const Lock other)

◆ ~Lock()

Cairo::Device::Lock::~Lock ( )

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