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
{
... // manipulate context
}
// context is restored to initial state
RAII-style context save/restore class.
Definition context.h:1721
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: