28 #ifndef __RTTR_TYPE_H__
29 #define __RTTR_TYPE_H__
33 #include <type_traits>
48 template<
typename TargetType,
typename SourceType>
56 struct base_class_info;
57 struct type_converter_base;
64 static type get_invalid_type();
188 bool operator<(
const type& other)
const;
195 bool operator>(
const type& other)
const;
202 bool operator>=(
const type& other)
const;
209 bool operator<=(
const type& other)
const;
217 bool operator==(
const type& other)
const;
225 bool operator!=(
const type& other)
const;
242 std::string get_name()
const;
249 bool is_valid()
const;
256 operator bool()
const;
266 type get_raw_type()
const;
287 static type get(T&& object);
297 static type get(
const char* name);
306 static std::vector<type> get_types();
313 bool is_class()
const;
320 bool is_enumeration()
const;
337 bool is_array()
const;
344 bool is_pointer()
const;
351 bool is_primitive()
const;
358 bool is_derived_from(
const type& other)
const;
366 bool is_derived_from()
const;
373 std::vector<type> get_base_classes()
const;
380 std::vector<type> get_derived_classes()
const;
394 constructor get_constructor(
const std::vector<type>& params = std::vector<type>() )
const;
401 std::vector<constructor> get_constructors()
const;
410 variant create(std::vector<detail::argument> args)
const;
428 void destroy(
variant& obj)
const;
438 property get_property(
const std::string& name)
const;
446 std::vector<property> get_properties()
const;
455 static property get_global_property(
const std::string& name);
462 static std::vector<property> get_global_properties();
472 variant get_property_value(
const std::string& name, detail::instance obj)
const;
479 static variant get_property_value(
const std::string& name);
488 bool set_property_value(
const std::string& name, detail::instance obj, detail::argument arg)
const;
495 static bool set_property_value(
const std::string& name, detail::argument arg);
505 method get_method(
const std::string& name)
const;
515 method get_method(
const std::string& name,
const std::vector<type>& params)
const;
523 std::vector<method> get_methods()
const;
532 static method get_global_method(
const std::string& name);
542 static method get_global_method(
const std::string& name,
const std::vector<type>& params);
549 static std::vector<method> get_global_methods();
560 variant invoke(
const std::string& name, detail::instance obj, std::vector<detail::argument> args)
const;
568 static variant invoke(
const std::string& name, std::vector<detail::argument> args);
587 static void register_converter_func(F func);
611 static void* apply_offset(
void* ptr,
const type& source_type,
const type& target_type);
619 detail::type_converter_base* get_type_converter(
const type& target_type)
const;
632 static type register_type(
const char* name,
633 const type& raw_type,
634 std::vector<detail::base_class_info> base_classes,
635 detail::derived_info(*get_derived_func)(
void*),
636 variant(*variant_create_func)(
void*),
643 void register_type_converter(std::unique_ptr<detail::type_converter_base> converter)
const;
645 variant create_from_ptr(
void* ptr)
const;
648 friend struct impl::MetaTypeInfo;
653 friend type impl::get_invalid_type();
656 friend class detail::instance;
658 template<
typename TargetType,
typename SourceType>
659 friend TargetType
rttr_cast(SourceType
object);
696 #define RTTR_DECLARE_TYPE(Type)
703 #define RTTR_DECLARE_STANDARD_TYPE_VARIANTS(Type)
722 #define RTTR_DEFINE_TYPE(Type)
728 #include "rttr/impl/type_impl.h"
730 #endif // __RTTR_TYPE_H__
This class holds the type information for any arbitrary object.
Definition: type.h:165
The destructor class provides a destructor for registered types.
Definition: destructor.h:72
uint16 type_id
Definition: type.h:168
The enumeration class provides several meta information about an enum.
Definition: enumeration.h:96
The method class provides several meta information about a method and can be invoked.
Definition: method.h:112
TargetType rttr_cast(SourceType object)
Casts the given object of type SourceType to an object of type TargetType.
The variant class allows to store data of any type and convert between these types transparently...
Definition: variant.h:125
This class is used to register the constructors, properties, methods and enumeration for a certain cl...
Definition: register_reflection.h:129
unsigned short uint16
Definition: core_prerequisites.h:132
The constructor class provides several meta information about a constructor and can be invoked...
Definition: constructor.h:90
#define RTTR_API
Definition: core_prerequisites.h:124