30 throw std::bad_any_cast();
32 throw std::bad_any_cast();
33 return reinterpret_cast<T *
>(
ptr);
49template <
class T,
class S>
53#define PARAMS_TABLE(type_, ...) \
55 struct attribute_table<type_, S> { \
57 inline static const attribute_table_t<S> table{__VA_ARGS__}; \
62#define PARAMS_MEMBER(name, ...) \
64 #name, attribute_accessor<S>::template make<type>(&type::name, \
75template <
class T,
class S>
79#define PARAMS_ALIAS_TABLE(type_, ...) \
81 struct attribute_alias_table<type_, S> { \
83 inline static const attribute_alias_table_t<S> table{__VA_ARGS__}; \
88#define PARAMS_MEMBER_ALIAS(alias, name) \
93template <
class T,
class S>
97template <
class T,
class S>
98using enum_table_t = std::map<std::string_view, enum_accessor<T, S>>;
102template <
class T,
class S>
106#define ENUM_TABLE(type_, ...) \
108 struct enum_table<type_, S> { \
109 using type = type_; \
110 inline static const enum_table_t<type, S> table{__VA_ARGS__}; \
115#define ENUM_MEMBER(name, ...) \
117 #name, { type::name, __VA_ARGS__ } \
Like std::any, but storing just the pointer, without any dynamic allocation.
const std::type_info * ptr_type
std::map< std::string_view, std::string_view > attribute_alias_table_t
Dictionary that maps struct attribute names to type-erased functions that set those attributes.
std::map< std::string_view, attribute_accessor< S > > attribute_table_t
Dictionary that maps struct attribute names to type-erased functions that set those attributes.
std::map< std::string_view, enum_accessor< T, S > > enum_table_t
Dictionary that maps enumerator names to their values and documentation.
Function wrapper to set attributes of a struct, type-erasing the type of the attribute.
Specialize this type to define the alternative attribute name to attribute setters dictionaries for a...
Specialize this type to define the attribute name to attribute setters dictionaries for a struct type...
Function wrapper access the enumerators of an enum, type-erasing the type of the enum.
Specialize this type to define the enumerator name to value dictionaries for an enum type T.