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