1#include "reflect_enum.h"
3#include <cgv/utils/convert.h>
9void abst_enum_reflection_traits::parse_declarations()
24 *
static_cast<int*
>(member_ptr) = ref_values()[i];
32 str_val = to_string(ref_names()[i]);
void parse_enum_declarations(const std::string &enum_declarations, std::vector< token > &enum_names, std::vector< int > &enum_values)
parse an enum declaration string into names and values
unsigned find_enum_index(int value, const std::vector< int > &enum_values)
convert value to index
Helper functions to process enum declarations from strings.
type independent functionality for all enum fallback implementations
std::string get_enum_name(unsigned i) const
return the name of the i-th enum item
void get_to_string(const void *member_ptr, std::string &str_val)
convert given instance into a string value
bool set_from_string(void *member_ptr, const std::string &str_val)
convert a given string value to the reflected type and store in the instance pointer
unsigned get_nr_enum_items() const
return the number of enum items
bool has_string_conversions() const
whether type can be converted to string, defaults to false
int get_enum_value(unsigned i) const
return the value of the i-th enum item
bool has_enum_interface() const
return whether the traits class implements the enum interface