cgv
Loading...
Searching...
No Matches
reflection_traits.cxx
1#include "reflection_traits.h"
2#include "reflection_handler.h"
3
4namespace cgv {
5 namespace reflect {
6
10
12{
13 return true;
14}
15
17{
18 return true;
19}
20
22{
23 return false;
24}
25
26bool abst_reflection_traits::set_from_string(void* member_ptr, const std::string& str_val)
27{
28 return false;
29}
30
31void abst_reflection_traits::get_to_string(const void* member_ptr, std::string& str_val)
32{
33}
34
36{
37 return false;
38}
39
40
42{
43 return false;
44}
45
47{
48 return 0;
49}
50
51std::string abst_reflection_traits::get_enum_name(unsigned i) const
52{
53 return "";
54}
55
57{
58 return -1;
59}
60
61reflection_traits<bool,RTK_STD_TYPE> get_reflection_traits(const bool&)
62{
64}
65
66
67 }
68}
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
the cgv namespace
Definition print.h:11
virtual std::string get_enum_name(unsigned i) const
return the name of the i-th enum item
virtual bool is_enum_type() const
return whether type is an enum type - this is independent of whether enum interface is implemented
virtual bool has_string_conversions() const
whether type can be converted to string, defaults to false
virtual int get_enum_value(unsigned i) const
return the value of the i-th enum item
virtual ~abst_reflection_traits()
provide virtual destructor to allow generation of copies
virtual bool has_external_implementation() const
whether type can be converted to string, defaults to false
virtual void get_to_string(const void *instance_ptr, std::string &str_val)
convert given instance into a string value
virtual bool has_enum_interface() const
return whether the traits class implements the enum interface
virtual bool external_implementation(reflection_handler &rh, void *member_ptr)
call the external implementation
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
virtual unsigned get_nr_enum_items() const
return the number of enum items
Default implementation of the reflection traits providing type specific interface.