cgv
cgv::reflect::reflection_traits< T, KIND, has_str > Struct Template Referenceabstract

Default implementation of the reflection traits providing type specific interface. More...

#include <reflection_traits.h>

Inheritance diagram for cgv::reflect::reflection_traits< T, KIND, has_str >:
cgv::reflect::reflection_traits_string_impl< true, T, abst_reflection_traits > cgv::reflect::reflection_traits_impl< T, abst_reflection_traits > cgv::reflect::abst_reflection_traits

Public Member Functions

abst_reflection_traitsclone ()
 clone function
 
unsigned size () const
 return the size of the type
 
void * new_instance () const
 construct an instance on the heap with the new operator
 
void delete_instance (void *instance_ptr) const
 delete an instance with the delete operator
 
void * new_instances (unsigned n) const
 construct n instances on the heap with the new operator
 
void delete_instances (void *instance_array) const
 delete instances with the delete [] operator
 
cgv::type::info::TypeId get_type_id () const
 return the type id
 
const char * get_type_name () const
 return the type name
 
bool is_enum_type () const
 return whether type is an enum type - this is independent of whether enum interface is implemented
 
additional enum interface
virtual bool is_enum_type () const
 return whether type is an enum type - this is independent of whether enum interface is implemented
 
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 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
 
additional enum interface
virtual bool is_enum_type () const
 return whether type is an enum type - this is independent of whether enum interface is implemented
 
self reflection through external implementation
virtual bool has_external_implementation () const
 whether type can be converted to string, defaults to false
 
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 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
virtual bool has_external_implementation () const
 whether type can be converted to string, defaults to false
 
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 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
 
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 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
 
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 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
virtual bool has_external_implementation () const
 whether type can be converted to string, defaults to false
 
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 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
virtual bool has_external_implementation () const
 whether type can be converted to string, defaults to false
 
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 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
 
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 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
 
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 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
 
additional enum interface
virtual bool is_enum_type () const
 return whether type is an enum type - this is independent of whether enum interface is implemented
 
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 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
 
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 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
 
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 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
 

Static Public Attributes

self reflection through string conversions
static const bool has_string = false
 compile information about string conversions
 
self reflection through string conversions
static const bool has_string = false
 compile information about string conversions
 
self reflection through string conversions
static const bool has_string = false
 compile information about string conversions
 

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
 

Detailed Description

template<typename T, ReflectionTraitsKind KIND = RTK_STRING, bool has_str = true>
struct cgv::reflect::reflection_traits< T, KIND, has_str >

Default implementation of the reflection traits providing type specific interface.


The documentation for this struct was generated from the following file: