IMP  2.0.1
The Integrative Modeling Platform
atom_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/atom_macros.h \brief Various important macros
3  * for implementing decorators.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_MACROS_H
10 #define IMPATOM_MACROS_H
11 
12 #define IMP_ATOM_TYPE_INDEX 8974343
13 #define IMP_RESIDUE_TYPE_INDEX 90784334
14 #define IMP_HIERARCHY_TYPE_INDEX 90784335
15 //! Define the basic things you need for a ForceFieldParameters.
16 /** In addition to the methods done by all the macros, it declares
17  - IMP::Restraint::evaluate()
18  - IMP::Restraint::incremental_evaluate()
19  and it defines
20  - IMP::Restraint::get_is_incremental() to return true
21 */
22 #define IMP_FORCE_FIELD_PARAMETERS(Name) \
23  IMP_OBJECT(Name)
24 
25 //! Define the basic things you need for a pdb selector
26 /** In addition to the methods defined/declared by IMP_OBJECT,
27  it defines:
28  - IMP::PDBSelector::get_is_selected()
29  The selected argument should return true or false and use
30  a string called pdb_line.
31  */
32 #define IMP_PDB_SELECTOR(Name, parent, selected, show) \
33  Name(std::string name): parent(name){} \
34  Name(): parent(std::string(#Name)+"%1%"){} \
35  bool get_is_selected(const std::string &pdb_line) const { \
36  selected; \
37  } \
38  IMP_OBJECT_METHODS(Name)
39 
40 
41 //! Define the basic things you need for a mol2 selector
42 /** In addition to the methods defined/declared by IMP_OBJECT,
43  it defines:
44  - IMP::Mol2Selector::get_is_selected()
45  The selected argument should return true or false and use
46  a string called pdb_line.
47  */
48 #define IMP_MOL2_SELECTOR(Name, selected, show) \
49  bool get_is_selected(const std::string &mol2_line) const { \
50  selected; \
51  } \
52  IMP_OBJECT_METHODS(Name)
53 
54 
55 /** Add the methods needed for a Simulator
56  */
57 #define IMP_SIMULATOR(Name) \
58  private: \
59  virtual void setup(const ParticleIndexes &ps); \
60  virtual double do_step(const ParticleIndexes &sc, double dt); \
61  virtual bool get_is_simulation_particle(ParticleIndex p) const; \
62 public:
63 
64 #endif /* IMPATOM_MACROS_H */