IMP Reference Guide
2.19.0
The Integrative Modeling Platform
|
Macros to aid in writing RAII-style classes. More...
Go to the source code of this file.
Macros | |
#define | IMP_RAII(Name, args, Initialize, Set, Reset, Show) |
Declares RAII-style methods in a class. More... | |
Macros to aid in writing RAII-style classes.
Copyright 2007-2022 IMP Inventors. All rights reserved.
Definition in file raii_macros.h.
#define IMP_RAII | ( | Name, | |
args, | |||
Initialize, | |||
Set, | |||
Reset, | |||
Show | |||
) |
Declares RAII-style methods in a class.
Since such class methods are typically quite small and simple, all the implementation is inline. The macro declares
Name | the class name |
args | the argument string (in parentheses) for the explicit constructor and set() |
Initialize | code called from any constructor, including the default |
Set | the code called from the explicit constructor or the set() function |
Reset | the code called from the destructor, and in set before calling the Set code |
Show | the code for the show() method |
Definition at line 34 of file raii_macros.h.