58 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
59 ->
typename std::enable_if<is_callable<F, double*, double&, ODEIntegrator*>::value,
decltype(std::declval<F>()(y, x, integrator))>::type
61 return func(y, x, integrator);
66 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
67 ->
typename std::enable_if<is_callable<F, double*, double&>::value,
decltype(std::declval<F>()(y, x))>::type
74 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
75 ->
typename std::enable_if<is_callable<F, double*>::value,
decltype(std::declval<F>()(y))>::type
87 using FuncType = Func;
89 : func_(std::move(func))
93 return this->operator()(y, x, integrator);
100 template<
typename F = FuncType>
102 typename std::enable_if<!std::is_void<
decltype(
103 ODEStateObserverGenericHelper::call_func
104 (std::declval<F&>(), std::declval<double*>(), std::declval<double&>(), std::declval<ODEIntegrator*>()))>::value, EODEAction>::type
105 operator()(
double* y,
double& x,
ODEIntegrator* integrator) {
106 return ODEStateObserverGenericHelper::call_func(func_, y, x, integrator);
109 template<
typename F = FuncType>
111 typename std::enable_if<std::is_void<
decltype(
112 ODEStateObserverGenericHelper::call_func
113 (std::declval<F&>(), std::declval<double*>(), std::declval<double&>(), std::declval<ODEIntegrator*>()))>::value, EODEAction>::type
114 operator()(
double* y,
double& x, ODEIntegrator* integrator) {
115 ODEStateObserverGenericHelper::call_func(func_, y, x, integrator);
116 return EODEAction::eContinue;