1#include "get_reflection_handler.h"
2#include <cgv/type/variant.h>
12 const std::string& _value_type,
26 if (info::is_fundamental(value_rt->
get_type_id())) {
44 rt->
get_to_string(member_ptr, *
static_cast<std::string*
>(value_ptr));
50 cgv::type::assign_variant(value_type, value_ptr, rt->
get_type_name(), member_ptr);
54 memcpy(value_ptr, member_ptr, rt->
size());
58 rt->
get_to_string(member_ptr, *
static_cast<std::string*
>(value_ptr));
The cgv::reflect::find_reflection_hander steers traversal to a specific member and calls the virtual ...
virtual void process_member_void(const std::string &member_name, void *member_ptr, abst_reflection_traits *rt, GroupKind group_kind=GK_NO_GROUP, unsigned grp_size=-1)
virtual method that is overloaded by derived classes to handle the target member
get_reflection_handler(const std::string &_target, const std::string &_value_type, void *_value_ptr, abst_reflection_traits *_value_rt=0)
construct from target, value type and pointer to value
void process_member_void(const std::string &member_name, void *member_ptr, abst_reflection_traits *rt, GroupKind group_kind, unsigned grp_size)
copy value of member to external value pointer
GroupKind
different support group types
@ TI_STRING
wide character type
namespace for compile time type information
this header is dependency free
abstract interface for type reflection with basic type management and optional string conversion
virtual unsigned size() const =0
return the size of the type
virtual bool has_string_conversions() const
whether type can be converted to string, defaults to false
virtual cgv::type::info::TypeId get_type_id() const =0
return the type id
virtual const char * get_type_name() const =0
return the type name
virtual void get_to_string(const void *instance_ptr, std::string &str_val)
convert given instance into a string value
virtual bool set_from_string(void *instance_ptr, const std::string &str_val)
convert a given string value to the reflected type and store in the instance pointer
traits class with a static function get_name() of type const char* that returns the type name of the ...