File indexing completed on 2025-01-18 09:54:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef ParamToArgAdaptor_h_
0020 #define ParamToArgAdaptor_h_
0021
0022 #include <functional>
0023 #include <iostream>
0024 #include <string>
0025 #include "CLHEP/GenericFunctions/Parameter.hh"
0026 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0027
0028 namespace Genfun {
0029
0030
0031
0032
0033
0034 template <class F>
0035 class ParamToArgAdaptor : public AbsFunction {
0036
0037 FUNCTION_OBJECT_DEF(ParamToArgAdaptor)
0038
0039 public:
0040
0041
0042 typedef Parameter & (F::*ScopedMethodPtr) ();
0043
0044
0045 ParamToArgAdaptor(const F & function,
0046 ScopedMethodPtr parameterFetchMethod);
0047
0048
0049 ParamToArgAdaptor(const ParamToArgAdaptor &right);
0050
0051
0052 virtual ~ParamToArgAdaptor();
0053
0054
0055 virtual double operator ()(double argument) const override;
0056 virtual double operator ()(const Argument & a) const override;
0057
0058
0059 virtual unsigned int dimensionality() const override;
0060
0061
0062 Parameter & scaleFactor();
0063 const Parameter & scaleFactor() const;
0064
0065
0066 private:
0067
0068
0069 const ParamToArgAdaptor & operator=(const ParamToArgAdaptor &right);
0070
0071
0072 Parameter _scaleFactor;
0073
0074
0075 F *_function;
0076
0077
0078 std::mem_fun_ref_t<Parameter &, F> _parameterFetchMethod;
0079
0080 };
0081 }
0082 #include "CLHEP/GenericFunctions/ParamToArgAdaptor.icc"
0083 #endif