7 #ifndef SSMPACK_PROCESS_TRAITS_HPP
8 #define SSMPACK_PROCESS_TRAITS_HPP
16 #include <type_traits>
22 struct IsProcess : std::false_type {};
24 template <
typename A,
typename B,
typename C>
25 struct IsProcess<Markov<A, B, C>> : std::true_type {};
27 template <
typename A,
typename B>
28 struct IsProcess<Memoryless<A, B>> : std::true_type {};
30 template <
typename... Args>
33 template <
typename T,
typename... Args>
34 struct AreProcesses<T, Args...> {
35 static constexpr
bool value =
36 AreProcesses<Args...>::value && IsProcess<T>::value;
40 struct AreProcesses<> {
41 static constexpr
bool value =
true;
45 struct ModelTraits {};
46 template <
typename R,
typename C,
typename... Args>
47 struct ModelTraits<R (C::*)(Args...) const> {
49 static constexpr
size_t arity =
sizeof...(Args);
54 struct ProcessTraits {
55 static constexpr
bool valid =
false;
57 using TParamMap = void;
58 using TRandomVAR = void;
62 template <
typename T,
typename U,
typename V>
63 struct ProcessTraits<Markov<T, U, V>> {
64 static constexpr
bool valid =
true;
67 using TRandomVAR = decltype(std::declval<TPDF>().random());
68 using type = Markov<T, U, V>;
69 using TArity = std::integral_constant<
70 size_t, ModelTraits<decltype(&TParamMap::operator())>::arity - 1>;
73 template <
typename T,
typename U>
74 struct ProcessTraits<Memoryless<T, U>> {
75 static constexpr
bool valid =
true;
78 using TRandomVAR = decltype(std::declval<TPDF>().random());
79 using type = Memoryless<T, U>;
80 using TArity = std::integral_constant<
81 size_t, ModelTraits<decltype(&TParamMap::operator())>::arity>;