IMP  2.2.1
The Integrative Modeling Platform
base/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-2014 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
17  Initialization) provides a way of
18  temporarily changing something and undoing the
19  change when the RAII object
20  is destroyed. Examples include reference counting
21  and changing the log level
22  where you want to do something (increase the amount
23  of logging), but ensure
24  that when your function exits, things are put back
25  to how they were before.
26  */
27 class RAII : public NonCopyable {
28  protected:
29  RAII() {}
30 };
31 IMPBASE_END_NAMESPACE
32 
33 #endif /* IMPBASE_RAI_I_H */
Various general useful macros for IMP.
Basic types used by IMP.