IMP  2.1.1
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_DEPRECATED_RAII(version, help_message, MODULE, Name, args,Initialize, Set, Reset, Show)
 
#define IMP_RAII(Name, args, Initialize, Set, Reset, Show)
 Declares RAII-style methods in a class. More...
 

Detailed Description

Copyright 2007-2013 IMP Inventors. All rights reserved.

Definition in file base/raii_macros.h.

Macro Definition Documentation

#define IMP_DEPRECATED_RAII (   version,
  help_message,
  MODULE,
  Name,
  args,
  Initialize,
  Set,
  Reset,
  Show 
)

Like IMP_RAII, but for deprecated versions (it has hard to apply the deprecated macros oneself.

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

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