77 template <
typename EnumType>
91 template <
typename EnumType>
95 std::vector<std::string>
result;
96 result.reserve(pairs.size());
97 for (
const auto &p : pairs)
126#define DNDS_DEFINE_ENUM_JSON(EnumType_, ...) \
128 NLOHMANN_JSON_SERIALIZE_ENUM(EnumType_, __VA_ARGS__) \
130 inline std::vector<std::string> _dnds_enum_allowed_values_fn(EnumType_ *) \
132 return ::DNDS::detail::extractEnumStrings<EnumType_>(__VA_ARGS__); \
145#define DNDS_ENUM_ALLOWED_VALUES(EnumType_) \
146 _dnds_enum_allowed_values_fn(static_cast<EnumType_ *>(nullptr))
JSON-to-Eigen conversion utilities and nlohmann_json helper macros.
std::vector< std::string > extractEnumStrings(std::initializer_list< EnumStringPair< EnumType > > pairs)
Extract non-null string values from a list of enum-string pairs.
the host side operators are provided as implemented
A pair of (enum-value, optional string) used to extract allowed values.
EnumStringPair(EnumType v, const char *s)
EnumStringPair(EnumType v, std::nullptr_t)
Eigen::Matrix< real, 5, 1 > v