cairomm 1.18.0

Public Member Functions | List of all members
Cairo::SaveGuard Class Referencefinal

RAII-style context save/restore class. More...

`#include <cairomm/context.h>`

## Public Member Functions
| SaveGuard (const RefPtr< Context > &context)
| Constructor, the context is saved.
| ~SaveGuard ()
| Destructor, the context is restored.

## Detailed Description

RAII-style context save/restore class.

Cairo::Context::save() is called automatically when the object is created, and Cairo::Context::restore() is called when the object is destroyed. This allows you to write code such as:

// context initial state
{
Cairo::SaveGuard saver(context);
... // manipulate context
}
// context is restored to initial state
Cairo::SaveGuard
RAII-style context save/restore class.
Definition context.h:1722
Cairo::make_refptr_for_instance
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

Since cairomm 1.18:

## Constructor & Destructor Documentation

## ◆ SaveGuard()

Cairo::SaveGuard::SaveGuard | ( | const RefPtr< Context > & | context | ) |
| explicit

Constructor, the context is saved.

## ◆ ~SaveGuard()

Cairo::SaveGuard::~SaveGuard | ( |  | ) |

Destructor, the context is restored.

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

- cairomm/context.h