57 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
58 ->
typename std::enable_if<is_callable<F, double*, double&, ODEIntegrator*>::value,
decltype(std::declval<F>()(y, x, integrator))>::type
60 return func(y, x, integrator);
65 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
66 ->
typename std::enable_if<is_callable<F, double*, double&>::value,
decltype(std::declval<F>()(y, x))>::type
73 static A_ALWAYS_INLINE
auto call_func(F& func,
double* y,
double& x,
ODEIntegrator* integrator)
74 ->
typename std::enable_if<is_callable<F, double*>::value,
decltype(std::declval<F>()(y))>::type
86 using FuncType = Func;
88 : func_(std::move(func))
92 return this->operator()(y, x, integrator);
99 template<
typename F = FuncType>
101 typename std::enable_if<!std::is_void<
decltype(
102 ODEStateObserverGenericHelper::call_func
103 (std::declval<F&>(), std::declval<double*>(), std::declval<double&>(), std::declval<ODEIntegrator*>()))>::value, EODEAction>::type
104 operator()(
double* y,
double& x,
ODEIntegrator* integrator) {
105 return ODEStateObserverGenericHelper::call_func(func_, y, x, integrator);
108 template<
typename F = FuncType>
110 typename std::enable_if<std::is_void<
decltype(
111 ODEStateObserverGenericHelper::call_func
112 (std::declval<F&>(), std::declval<double*>(), std::declval<double&>(), std::declval<ODEIntegrator*>()))>::value, EODEAction>::type
113 operator()(
double* y,
double& x, ODEIntegrator* integrator) {
114 ODEStateObserverGenericHelper::call_func(func_, y, x, integrator);
115 return EODEAction::eContinue;