Template Struct value_serializer< T >
Defined in File serialize.hpp
Struct Documentation
-
template<typename T>
struct value_serializer<T> value_serializer for enum values
This class is used to (de-)serialize enum values. To map enum values to a string you should use the singleton instance accessible through instance() and then call the operator() members assinging each of the enum values with their respective string.
A recent addition is the init() call to initialize the instance
Public Types
-
using value_map_value_type = typename value_map_type::value_type
Public Functions
Public Static Functions
-
static inline void init(std::string_view name, std::initializer_list<value_map_value_type> values)
Initialize a new instance of value_serializer for this enum, with name and a set of name/value pairs.
-
static inline void init(std::initializer_list<value_map_value_type> values)
Initialize a new anonymous instance of value_serializer for this enum with a set of name/value pairs.
-
static inline value_serializer &instance(std::string name = {})
-
static inline std::string type_name()
-
static inline bool empty()
-
using value_map_value_type = typename value_map_type::value_type