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
58 template <
class CL,
class MT, MT CL::*ptr>
64 static constexpr
auto member_name = hana_member_name<CL, MT, ptr>;
66 static constexpr
auto min = element_min<CL, MT, ptr>;
67 static constexpr
auto max = element_max<CL, MT, ptr>;
68 static constexpr
auto description = element_description<CL, MT, ptr>;
69 static constexpr
auto property_name = element_property_name<CL, MT, ptr>;
70 static constexpr
auto decimals = element_decimals<CL, MT, ptr>;
71 static constexpr
auto steps = element_steps<CL, MT, ptr>;
72 static constexpr
auto label = element_label<CL, MT, ptr>;
111 static constexpr
bool
115 static_assert(undefined_t_or_type<const char*>(
label),
116 "if set, element_label has to be of type const char*");
117 static_assert(undefined_t_or_type<const char*>(
description),
118 "if set, element_description has to be of type const char*");
119 static_assert(undefined_t_or_type<const char*>(
property_name),
120 "if set, element_property_name has to be of type const char*");
123 if constexpr (simox::meta::is_any_of_v<MT, std::string, bool>)
125 static_assert(is_undefined_t(
min),
126 "element_min can't be set for std::string or bool");
127 static_assert(is_undefined_t(
max),
128 "element_max can't be set for std::string or bool");
129 static_assert(is_undefined_t(
steps),
130 "element_steps can't be set for std::string or bool");
131 static_assert(is_undefined_t(
decimals),
132 "element_decimals can't be set for std::string or bool");
134 else if constexpr (std::is_integral_v<MT>)
136 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
min),
137 "if set, element_min has to be of the same type as the element");
138 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
max),
139 "if set, element_max has to be of the same type as the element");
141 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
142 "if set, element_steps has to be of type int");
143 static_assert(is_undefined_t(
decimals),
144 "element_decimals can't be set for integral types");
146 else if constexpr (std::is_floating_point_v<MT>)
148 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
min),
149 "if set, element_min has to be of the same type as the element");
150 static_assert(undefined_t_or_type_or_array_sz_1<MT>(
max),
151 "if set, element_max has to be of the same type as the element");
153 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
154 "if set, element_steps has to be of type int");
155 static_assert(undefined_t_or_type_or_array_sz_1<int>(
decimals),
156 "if set, element_decimals has to be of type int");
158 else if constexpr (std::is_same_v<MT, Eigen::Vector3f>)
160 static_assert(undefined_t_or_type_or_array_sz_1<float>(
min),
161 "if set, element_min has to be of the same type as the element");
162 static_assert(undefined_t_or_type_or_array_sz_1<float>(
max),
163 "if set, element_max has to be of the same type as the element");
165 static_assert(undefined_t_or_type_or_array_sz_1<int>(
steps),
166 "if set, element_steps has to be of type int");
167 static_assert(undefined_t_or_type_or_array_sz_1<int>(
decimals),
168 "if set, element_decimals has to be of type int");
174 static_assert(is_undefined_t(
min),
"element_min can't be set for this type");
175 static_assert(is_undefined_t(
max),
"element_max can't be set for this type");
176 static_assert(is_undefined_t(
steps),
"element_steps can't be set for this type");
177 static_assert(is_undefined_t(
decimals),
178 "element_decimals can't be set for this type");
186 template <
class VarName,
class CL,
class MT, MT CL::*ptr>
188 const boost::hana::pair<VarName, boost::hana::struct_detail::member_ptr<MT CL::*, ptr>>&);