IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
IMP::RAII Class Reference

Temporarily change something; undo the change when this object is destroyed. More...

#include <IMP/RAII.h>

+ Inheritance diagram for IMP::RAII:

Detailed Description

Temporarily change something; undo the change when this object is destroyed.

An RAII class (Resource Acquisition Is Initialization) provides a way of temporarily changing something and undoing the change when the RAII object is destroyed. Examples include reference counting and changing the log level where you want to do something (increase the amount of logging), but ensure that when your function exits, things are put back to how they were before.

In Python, all RAII objects also support the context manager protocol (the 'with' statement), and its use is strongly encouraged.

Definition at line 28 of file RAII.h.


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