IMP  2.2.0
The Integrative Modeling Platform
base/raii_macros.h File Reference

Various general useful macros for IMP. More...

#include <IMP/base/base_config.h>
#include "showable_macros.h"
#include "RAII.h"
+ Include dependency graph for base/raii_macros.h:
+ This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

Copyright 2007-2014 IMP Inventors. All rights reserved.

Definition in file base/raii_macros.h.

Macro Definition Documentation

#define IMP_RAII (   Name,
  args,
  Initialize,
  Set,
  Reset,
  Show 
)

Since such class methods are typically quite small and simple, all the implementation is inline. The macro declares

  • default constructor
  • explicit constructor
  • RAII::set()
  • RAII::reset()
  • destructor
Parameters
Namethe class name
argsthe argument string (in parens) for the explicit constructor and set()
Initializecode called from any constrcutor, including the default
Setthe code called from the explicit constructor or the set() function
Resetthe code called from the destructor, and in set before calling the Set code
Showthe code for the show() method

Definition at line 34 of file base/raii_macros.h.