cairomm  1.16.2
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. More...
 
 ~SaveGuard ()
 Destructor, the context is restored. More...
 

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
RAII-style context save/restore class.
Definition: context.h:1722
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: