1#include "set_reflection_handler.h"
2#include <cgv/type/variant.h>
3#include <cgv/type/info/type_id.h>
33 if (info::is_fundamental(value_rt->
get_type_id())) {
51 valid = rt->
set_from_string(member_ptr, *
static_cast<const std::string*
>(value_ptr));
56 cgv::type::assign_variant(rt->
get_type_name(), member_ptr, value_type, value_ptr);
60 memcpy(member_ptr, value_ptr, rt->
size());
64 valid = rt->
set_from_string(member_ptr, *
static_cast<const 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
GroupKind
different support group types
bool is_creative() const
this should return true
void process_member_void(const std::string &member_name, void *member_ptr, abst_reflection_traits *rt, GroupKind group_kind, unsigned grp_size)
virtual method that is overloaded by derived classes to handle the target member
set_reflection_handler(const std::string &_target, const std::string &_value_type, const void *_value_ptr, abst_reflection_traits *_value_rt=0)
construct from target, value type, pointer to value and optionally reflection_traits
@ TI_STRING
wide character type
namespace for compile time type information
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