9 #ifndef IMPBASE_RAII_MACROS_H
10 #define IMPBASE_RAII_MACROS_H
11 #include <IMP/base/base_config.h>
34 #define IMP_RAII(Name, args, Initialize, Set, Reset, Show) \
35 IMP_HELPER_MACRO_PUSH_WARNINGS Name() { Initialize; } \
37 explicit Name args { \
47 void reset() { Reset; } \
48 ~Name() { reset(); } \
49 IMP_HELPER_MACRO_POP_WARNINGS IMP_SHOWABLE_INLINE(Name, out << #Name << '('; \
53 #define IMP_DEPRECATED_RAII(version, help_message, MODULE, Name, args, \
54 Initialize, Set, Reset, Show) \
60 IMP_SHOWABLE_INLINE(Name, out << #Name << '('; Show; out << ')')
64 #define IMP_DEPRECATED_RAII(version, help_message, MODULE, Name, args, \
65 Initialize, Set, Reset, Show) \
66 IMP_HELPER_MACRO_PUSH_WARNINGS IMP##MODULE##_DEPRECATED_VALUE_DECL(version) \
68 IMP##MODULE##_DEPRECATED_VALUE_DEF(version, help_message); \
71 IMP##MODULE##_DEPRECATED_VALUE_DECL(version) explicit Name args { \
72 IMP##MODULE##_DEPRECATED_VALUE_DEF(version, help_message); \
80 void reset() { Reset; } \
81 ~Name() { reset(); } \
82 IMP_HELPER_MACRO_POP_WARNINGS IMP_SHOWABLE_INLINE(Name, out << #Name << '('; \
Various general useful macros for IMP.