|
cgv
|
abstract interface for type reflection with basic type management and optional string conversion More...
#include <reflection_traits.h>
Public Member Functions | |
| virtual | ~abst_reflection_traits () |
| provide virtual destructor to allow generation of copies | |
| virtual abst_reflection_traits * | clone ()=0 |
| clone function | |
basic type interface | |
| virtual unsigned | size () const =0 |
| return the size of the type | |
| virtual void * | new_instance () const =0 |
| construct an instance on the heap with the new operator | |
| virtual void | delete_instance (void *) const =0 |
| delete an instance with the delete operator | |
| virtual void * | new_instances (unsigned n) const =0 |
| construct n instances on the heap with the new operator | |
| virtual void | delete_instances (void *) const =0 |
| delete instances with the delete [] operator | |
| 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 | |
self reflection through external implementation | |
| static const bool | has_external = false |
| compile information about external implementation | |
| virtual bool | has_external_implementation () const |
| whether type can be converted to string, defaults to false | |
| virtual bool | external_implementation (reflection_handler &rh, void *member_ptr) |
| call the external implementation | |
self reflection through string conversions | |
| static const bool | has_string = false |
| compile information about string conversions | |
| virtual bool | has_string_conversions () const |
| whether type can be converted to string, defaults to false | |
| 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 void | get_to_string (const void *instance_ptr, std::string &str_val) |
| convert given instance into a string value | |
additional enum interface | |
| static const bool | has_enum = false |
| compile information about enum interface | |
| 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_enum_interface () const |
| return whether the traits class implements the enum interface | |
| virtual unsigned | get_nr_enum_items () const |
| return the number of enum items | |
| virtual std::string | get_enum_name (unsigned i) const |
| return the name of the i-th enum item | |
| virtual int | get_enum_value (unsigned i) const |
| return the value of the i-th enum item | |
abstract interface for type reflection with basic type management and optional string conversion
Definition at line 23 of file reflection_traits.h.
|
virtual |
provide virtual destructor to allow generation of copies
Definition at line 7 of file reflection_traits.cxx.
|
pure virtual |
clone function
Implemented in cgv::reflect::enum_reflection_traits< T >.
Referenced by cgv::reflect::find_reflection_handler::process_member_void().
|
pure virtual |
delete an instance with the delete operator
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
|
pure virtual |
delete instances with the delete [] operator
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
|
virtual |
call the external implementation
Definition at line 16 of file reflection_traits.cxx.
|
virtual |
return the name of the i-th enum item
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 51 of file reflection_traits.cxx.
|
virtual |
return the value of the i-th enum item
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 56 of file reflection_traits.cxx.
|
virtual |
return the number of enum items
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 46 of file reflection_traits.cxx.
|
virtual |
convert given instance into a string value
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 31 of file reflection_traits.cxx.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), cgv::reflect::debug_reflection_handler::reflect_group_begin(), cgv::reflect::debug_reflection_handler::reflect_member_void(), and cgv::data::ascii_write_reflection_handler::reflect_member_void().
|
pure virtual |
return the type id
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), cgv::reflect::debug_reflection_handler::reflect_member_void(), cgv::data::ascii_read_reflection_handler::reflect_member_void(), cgv::data::ascii_write_reflection_handler::reflect_member_void(), cgv::data::binary_read_reflection_handler::reflect_member_void(), and cgv::data::binary_write_reflection_handler::reflect_member_void().
|
pure virtual |
return the type name
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), cgv::reflect::debug_reflection_handler::reflect_group_begin(), cgv::reflect::find_reflection_handler::reflect_group_begin(), cgv::base::property_declaration_reflection_handler::reflect_member_void(), cgv::reflect::debug_reflection_handler::reflect_member_void(), cgv::reflect::find_reflection_handler::reflect_member_void(), and cgv::reflect::debug_reflection_handler::reflect_method_void().
|
virtual |
return whether the traits class implements the enum interface
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 41 of file reflection_traits.cxx.
|
virtual |
whether type can be converted to string, defaults to false
Definition at line 11 of file reflection_traits.cxx.
|
virtual |
whether type can be converted to string, defaults to false
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 21 of file reflection_traits.cxx.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), cgv::reflect::debug_reflection_handler::reflect_group_begin(), cgv::reflect::debug_reflection_handler::reflect_member_void(), cgv::data::ascii_read_reflection_handler::reflect_member_void(), and cgv::data::ascii_write_reflection_handler::reflect_member_void().
|
virtual |
return whether type is an enum type - this is independent of whether enum interface is implemented
Reimplemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
Definition at line 35 of file reflection_traits.cxx.
|
pure virtual |
construct an instance on the heap with the new operator
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
|
pure virtual |
construct n instances on the heap with the new operator
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
|
virtual |
convert a given string value to the reflected type and store in the instance pointer
Reimplemented in cgv::reflect::abst_enum_reflection_traits.
Definition at line 26 of file reflection_traits.cxx.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), and cgv::data::ascii_read_reflection_handler::reflect_member_void().
|
pure virtual |
return the size of the type
Implemented in cgv::reflect::reflection_traits_impl< T, abst_enum_reflection_traits >, and cgv::reflect::reflection_traits_impl< T, abst_reflection_traits >.
Referenced by cgv::reflect::get_reflection_handler::process_member_void(), cgv::reflect::set_reflection_handler::process_member_void(), cgv::data::binary_read_reflection_handler::reflect_member_void(), and cgv::data::binary_write_reflection_handler::reflect_member_void().
|
static |
compile information about enum interface
Definition at line 74 of file reflection_traits.h.
|
static |
compile information about external implementation
Definition at line 51 of file reflection_traits.h.
|
static |
compile information about string conversions
Definition at line 61 of file reflection_traits.h.