cairomm: Cairo::SaveGuard Class Reference

cairomm 1.19.1

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:1746

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