3 #include <SimoxUtility/meta/type_traits/is_any_of.h>
11 template<
class CL,
class MT, MT CL::* ptr>
14 template<
class CL,
class MT, MT CL::* ptr>
17 template<
class CL,
class MT, MT CL::* ptr>
20 template<
class CL,
class MT, MT CL::* ptr>
23 template<
class CL,
class MT, MT CL::* ptr>
26 template<
class CL,
class MT, MT CL::* ptr>
29 template<
class CL,
class MT, MT CL::* ptr>
32 template<
class CL,
class MT, MT CL::* ptr>
35 template<
class CL,
class MT, MT CL::* ptr>
38 template<
class CL,
class MT, MT CL::* ptr>
39 struct element_default : std::false_type
41 static const MT&
get()
45 static void set(CL& cl)
55 template<
class CL,
class MT, MT CL::* ptr>
61 static constexpr
auto member_name = hana_member_name <CL, MT, ptr>;
63 static constexpr
auto min = element_min <CL, MT, ptr>;
64 static constexpr
auto max = element_max <CL, MT, ptr>;
65 static constexpr
auto description = element_description <CL, MT, ptr>;
66 static constexpr
auto property_name = element_property_name<CL, MT, ptr>;
67 static constexpr
auto decimals = element_decimals <CL, MT, ptr>;
68 static constexpr
auto steps = element_steps <CL, MT, ptr>;
69 static constexpr
auto label = element_label <CL, MT, ptr>;
109 static_assert(undefined_t_or_type<const char*>(
label),
"if set, element_label has to be of type const char*");
110 static_assert(undefined_t_or_type<const char*>(
description),
"if set, element_description has to be of type const char*");
111 static_assert(undefined_t_or_type<const char*>(
property_name),
"if set, element_property_name has to be of type const char*");
114 if constexpr(simox::meta::is_any_of_v<MT, std::string, bool>)
116 static_assert(is_undefined_t(
min),
"element_min can't be set for std::string or bool");
117 static_assert(is_undefined_t(
max),
"element_max can't be set for std::string or bool");
118 static_assert(is_undefined_t(
steps),
"element_steps can't be set for std::string or bool");
119 static_assert(is_undefined_t(
decimals),
"element_decimals can't be set for std::string or bool");
121 else if constexpr(std::is_integral_v<MT>)
123 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
min),
"if set, element_min has to be of the same type as the element");
124 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
max),
"if set, element_max has to be of the same type as the element");
126 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
"if set, element_steps has to be of type int");
127 static_assert(is_undefined_t(
decimals),
"element_decimals can't be set for integral types");
129 else if constexpr(std::is_floating_point_v<MT>)
131 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
min),
"if set, element_min has to be of the same type as the element");
132 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
max),
"if set, element_max has to be of the same type as the element");
134 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
"if set, element_steps has to be of type int");
135 static_assert(undefined_t_or_type_or_array_sz_1<int>(
decimals),
"if set, element_decimals has to be of type int");
137 else if constexpr(std::is_same_v<MT, Eigen::Vector3f>)
139 static_assert(undefined_t_or_type_or_array_sz_1<float>(
min),
"if set, element_min has to be of the same type as the element");
140 static_assert(undefined_t_or_type_or_array_sz_1<float>(
max),
"if set, element_max has to be of the same type as the element");
142 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
"if set, element_steps has to be of type int");
143 static_assert(undefined_t_or_type_or_array_sz_1<int>(
decimals),
"if set, element_decimals has to be of type int");
149 static_assert(is_undefined_t(
min),
"element_min can't be set for this type");
150 static_assert(is_undefined_t(
max),
"element_max can't be set for this type");
151 static_assert(is_undefined_t(
steps),
"element_steps can't be set for this type");
152 static_assert(is_undefined_t(
decimals),
"element_decimals can't be set for this type");
159 template<
class VarName,
class CL,
class MT, MT CL::* ptr>
160 element_details<CL, MT, ptr>
162 const boost::hana::pair<VarName, boost::hana::struct_detail::member_ptr<MT CL::*, ptr>>&