31 #include "rttr/detail/base/core_prerequisites.h"
36 #include <type_traits>
55 template<
typename Target_Type,
typename Source_Type>
56 Target_Type
rttr_cast(Source_Type
object) RTTR_NOEXCEPT;
61 struct base_class_info;
62 struct type_converter_base;
64 class type_register_private;
66 static type get_invalid_type() RTTR_NOEXCEPT;
67 struct invalid_type{};
69 class destructor_wrapper_base;
70 class property_wrapper_base;
71 RTTR_LOCAL RTTR_INLINE type create_type(type_data*) RTTR_NOEXCEPT;
74 RTTR_LOCAL std::unique_ptr<type_data> make_type_data();
76 template<
typename T,
typename Tp,
typename Converter>
77 struct variant_data_base_policy;
79 struct type_comparator_base;
81 RTTR_API
bool compare_types_less_than(
const void*,
const void*,
const type&,
int&);
82 RTTR_API
bool compare_types_equal(
const void*,
const void*,
const type&,
bool&);
256 RTTR_INLINE
bool is_valid() const RTTR_NOEXCEPT;
263 RTTR_INLINE explicit operator
bool() const RTTR_NOEXCEPT;
273 RTTR_INLINE
type get_raw_type() const RTTR_NOEXCEPT;
295 RTTR_INLINE
type get_wrapped_type() const RTTR_NOEXCEPT;
303 RTTR_LOCAL static
type get() RTTR_NOEXCEPT;
316 RTTR_LOCAL static
type get(T&&
object) RTTR_NOEXCEPT;
344 RTTR_INLINE std::
size_t get_sizeof() const RTTR_NOEXCEPT;
351 RTTR_INLINE
bool is_class() const RTTR_NOEXCEPT;
371 RTTR_INLINE
bool is_template_instantiation() const RTTR_NOEXCEPT;
401 RTTR_INLINE
bool is_enumeration() const RTTR_NOEXCEPT;
430 RTTR_INLINE
bool is_wrapper() const RTTR_NOEXCEPT;
447 RTTR_INLINE
bool is_array() const RTTR_NOEXCEPT;
457 RTTR_INLINE
bool is_associative_container() const RTTR_NOEXCEPT;
467 RTTR_INLINE
bool is_sequential_container() const RTTR_NOEXCEPT;
475 RTTR_INLINE
bool is_pointer() const RTTR_NOEXCEPT;
484 RTTR_INLINE
bool is_arithmetic() const RTTR_NOEXCEPT;
492 RTTR_INLINE
bool is_function_pointer() const RTTR_NOEXCEPT;
500 RTTR_INLINE
bool is_member_object_pointer() const RTTR_NOEXCEPT;
508 RTTR_INLINE
bool is_member_function_pointer() const RTTR_NOEXCEPT;
519 bool is_derived_from(const
type& other) const RTTR_NOEXCEPT;
531 bool is_derived_from() const RTTR_NOEXCEPT;
542 bool is_base_of(const
type& other) const RTTR_NOEXCEPT;
554 bool is_base_of() const RTTR_NOEXCEPT;
695 bool destroy(
variant& obj) const RTTR_NOEXCEPT;
989 static
void register_converter_func(F func);
1015 template<typename T>
1016 static
void register_wrapper_converter_for_base_classes();
1040 template<typename T>
1041 static
void register_comparators();
1065 template<typename T>
1066 static
void register_equal_comparator();
1097 template<typename T>
1098 static
void register_less_than_comparator();
1105 type() RTTR_NOEXCEPT;
1112 RTTR_INLINE explicit
type(detail::type_data* data) RTTR_NOEXCEPT;
1122 static
void* apply_offset(
void* ptr, const
type& source_type, const
type& target_type) RTTR_NOEXCEPT;
1129 static
type get_derived_type(
void* ptr, const
type& source_type) RTTR_NOEXCEPT;
1138 const detail::type_converter_base* get_type_converter(const
type& target_type) const RTTR_NOEXCEPT;
1147 const detail::type_comparator_base* get_equal_comparator() const RTTR_NOEXCEPT;
1156 const detail::type_comparator_base* get_less_than_comparator() const RTTR_NOEXCEPT;
1164 RTTR_INLINE std::
size_t get_pointer_dimension() const RTTR_NOEXCEPT;
1173 RTTR_INLINE
type get_raw_array_type() const RTTR_NOEXCEPT;
1180 RTTR_INLINE
string_view get_full_name() const RTTR_NOEXCEPT;
1197 template<typename Target_Type, typename Source_Type>
1198 friend Target_Type
rttr_cast(Source_Type
object) RTTR_NOEXCEPT;
1201 friend class detail::type_register;
1202 friend class detail::type_register_private;
1204 friend
type detail::create_type(detail::type_data*) RTTR_NOEXCEPT;
1206 template<typename T>
1207 friend std::unique_ptr<detail::type_data> detail::make_type_data();
1209 template<typename T, typename Tp, typename Converter>
1210 friend struct detail::variant_data_base_policy;
1212 friend RTTR_API
bool detail::compare_types_less_than(const
void*, const
void*, const
type&,
int&);
1213 friend RTTR_API
bool detail::compare_types_equal(const
void*, const
void*, const
type&,
bool&);
1216 detail::type_data* m_type_data;
1221 #include "rttr/detail/type/type_impl.h"
The argument class is used for forwarding arguments to properties or methods.
Definition: argument.h:52
The array_range class provides a view into an underlying data structure with lower and upper limits.
Definition: array_range.h:64
The class template basic_string_view describes an non-owning reference to a constant contiguous seque...
Definition: string_view.h:49
The constructor class provides several meta information about a constructor and can be invoked.
Definition: constructor.h:89
The destructor class provides a destructor for registered types.
Definition: destructor.h:73
The enumeration class provides several meta information about an enum.
Definition: enumeration.h:113
The instance class is used for forwarding the instance of an object to invoke a property or method.
Definition: instance.h:48
The method class provides several meta information about a method and can be invoked.
Definition: method.h:121
The property class provides several meta information about a property and gives read/write access to ...
Definition: property.h:117
The type class holds the type information for any arbitrary object.
Definition: type.h:171
bool operator==(const type &other) const noexcept
Compares this type with the other type and returns true if both describe the same type,...
uintptr_t type_id
Definition: type.h:173
bool operator!=(const type &other) const noexcept
Compares this type with the other type and returns true if both describe different types,...
bool operator>(const type &other) const noexcept
Comparison operator for sorting the type data according to some internal criterion.
bool operator<=(const type &other) const noexcept
Comparison operator for sorting the type data according to some internal criterion.
bool operator<(const type &other) const noexcept
Comparison operator for sorting the type data according to some internal criterion.
type_id get_id() const noexcept
Returns the id of this type.
type & operator=(const type &other) noexcept
Assigns a type to another one.
bool operator>=(const type &other) const noexcept
Comparison operator for sorting the type data according to some internal criterion.
type(const type &other) noexcept
Assigns a type to another one.
The variant class allows to store data of any type and convert between these types transparently.
Definition: variant.h:198
Definition: access_levels.h:34
Target_Type rttr_cast(Source_Type object) noexcept
Casts the given object of type Source_Type to an object of type Target_Type.