18 #ifndef viskores_internal_FunctionInterface_h
19 #define viskores_internal_FunctionInterface_h
37 template <
typename OriginalSignature,
typename Transform>
38 struct FunctionInterfaceStaticTransformType;
105 template <
typename FunctionSignature>
106 class FunctionInterface
108 template <
typename OtherSignature>
109 friend class FunctionInterface;
112 using Signature = FunctionSignature;
121 explicit FunctionInterface(
const detail::ParameterContainer<FunctionSignature>& p)
127 using SigInfo = detail::FunctionSigInfo<FunctionSignature>;
128 using ComponentSig =
typename SigInfo::Components;
129 using ParameterSig =
typename SigInfo::Parameters;
131 template <viskores::IdComponent ParameterIndex>
134 using type =
typename detail::AtType<ParameterIndex, FunctionSignature>::type;
147 template <
typename Transform>
148 struct StaticTransformType
150 using type = FunctionInterface<
151 typename detail::FunctionInterfaceStaticTransformType<FunctionSignature, Transform>::type>;
199 template <
typename Transform>
200 VISKORES_CONT typename StaticTransformType<Transform>::type StaticTransformCont(
203 using FuncIface =
typename StaticTransformType<Transform>::type;
204 using PC = detail::ParameterContainer<typename FuncIface::Signature>;
205 return FuncIface{ detail::DoStaticTransformCont<PC>(transform, this->Parameters) };
208 detail::ParameterContainer<FunctionSignature> Parameters;
223 template <viskores::IdComponent ParameterIndex,
typename FunctionSignature>
224 VISKORES_EXEC_CONT auto ParameterGet(
const FunctionInterface<FunctionSignature>& fInterface)
225 -> decltype(detail::ParameterGet(fInterface.Parameters,
226 viskores::internal::IndexTag<ParameterIndex>{}))
228 return detail::ParameterGet(fInterface.Parameters,
229 viskores::internal::IndexTag<ParameterIndex>{});
247 template <
typename R,
typename... Args>
248 FunctionInterface<R(Args...)> make_FunctionInterface(
const Args&... args)
258 detail::ParameterContainer<R(Args...)> container = { args... };
259 return FunctionInterface<R(Args...)>{ container };
269 #endif //viskores_internal_FunctionInterface_h