IMP logo
IMP Reference Guide  2.12.0
The Integrative Modeling Platform
surface_distance_pair_score_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/score_functor/surface_distance_pair_score_macros.h
3  * \brief Various important macros for implementing decorators.
4  *
5  * Copyright 2007-2019 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPSCORE_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE_MACROS_H
10 #define IMPSCORE_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE_MACROS_H
11 
13 
14 #if defined(SWIG) || defined(IMP_DOXYGEN)
15 /** Use this macro to define PairScores based on the
16  IMP::score_functor::SurfaceDistancePairScore as it works around various
17  complications caused by SWIG.
18 
19  To use it do something like
20  IMP_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE(SurfaceDistancePairScore,
21  SurfaceDistancePairScore,
22  score_functor::UnaryFunctionEvaluate,
23  (UnaryFunction *uf, std::string name
24  = "SurfaceDistancePairScore%1%"), (uf));
25  */
26 #define IMP_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE(Name, PName, Functor, Args, PassArgs) \
27  class Name : public IMP::PairScore { \
28  typedef IMP::score_functor::PName<Functor> P; \
29  \
30  public: \
31  Name Args; \
32  double evaluate_index(Model *m, \
33  const ParticleIndexPair &pip, \
34  DerivativeAccumulator *da) const; \
35  ModelObjectsTemp do_get_inputs( \
36  Model *m, const ParticleIndexes &pis) const; \
37  IMP_OBJECT_METHODS(Name); \
38  }
39 
40 #else
41 #define IMP_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE(Name, PName, Functor, Args, PassArgs) \
42  class Name : public IMP::score_functor::PName<Functor> { \
43  typedef IMP::score_functor::PName<Functor> P; \
44  \
45  public: \
46  Name Args : P(Functor PassArgs, name) {} \
47  }
48 #endif
49 
50 #endif /* IMPSCORE_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE_MACROS_H */
A Score on the distance between a pair of particles.