IMP  2.0.1
The Integrative Modeling Platform
RAII.h
Go to the documentation of this file.
1 /**
2  * \file IMP/base/RAII.h \brief Basic types used by IMP.
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPBASE_RAI_I_H
9 #define IMPBASE_RAI_I_H
10 
11 #include <IMP/base/base_config.h>
12 #include "NonCopyable.h"
13 #include "utility_macros.h"
14 
15 IMPBASE_BEGIN_NAMESPACE
16 /** An RAII class (Resource Aquisition Is Initialization) provides a way of
17  temporarily changing something and undoing the change when the RAII object
18  is destroyed. Examples include reference counting and changing the log level
19  where you want to do something (increase the amount of logging), but ensure
20  that when your function exits, things are put back to how they were before.
21 */
22 class RAII: public NonCopyable {
23  protected:
24  RAII(){}
25 };
26 IMPBASE_END_NAMESPACE
27 
28 #endif /* IMPBASE_RAI_I_H */