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&);
179 RTTR_INLINE type(
const type& other) RTTR_NOEXCEPT;
186 RTTR_INLINE type& operator=(
const type& other) RTTR_NOEXCEPT;
193 RTTR_INLINE
bool operator<(
const type& other)
const RTTR_NOEXCEPT;
200 RTTR_INLINE
bool operator>(
const type& other)
const RTTR_NOEXCEPT;
207 RTTR_INLINE
bool operator>=(
const type& other)
const RTTR_NOEXCEPT;
214 RTTR_INLINE
bool operator<=(
const type& other)
const RTTR_NOEXCEPT;
222 RTTR_INLINE
bool operator==(
const type& other)
const RTTR_NOEXCEPT;
230 RTTR_INLINE
bool operator!=(
const type& other)
const RTTR_NOEXCEPT;
240 RTTR_INLINE type_id get_id() const RTTR_NOEXCEPT;
249 RTTR_INLINE
string_view get_name() const RTTR_NOEXCEPT;
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;
328 static type get_by_name(
string_view name) RTTR_NOEXCEPT;
337 static
array_range<type> get_types() 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;
394 array_range<type> get_template_arguments() 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;
567 array_range<type> get_base_classes() const RTTR_NOEXCEPT;
579 array_range<type> get_derived_classes() const RTTR_NOEXCEPT;
603 constructor get_constructor(const std::vector<type>& params = std::vector<type>() ) const RTTR_NOEXCEPT;
685 destructor get_destructor() const RTTR_NOEXCEPT;
695 bool destroy(
variant& obj) const RTTR_NOEXCEPT;
845 method get_method(
string_view name, const std::vector<type>& type_list) const RTTR_NOEXCEPT;
931 static
method get_global_method(
string_view name, const std::vector<type>& params) 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" 1223 #endif // RTTR_TYPE_H_ constexpr bool operator>=(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.
Definition: access_levels.h:33
constexpr bool operator==(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.
The array_range class provides a view into an underlying data structure with lower and upper limits...
Definition: array_range.h:63
constexpr bool operator<=(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.
The destructor class provides a destructor for registered types.
Definition: destructor.h:72
The instance class is used for forwarding the instance of an object to invoke a property or method...
Definition: instance.h:47
The enumeration class provides several meta information about an enum.
Definition: enumeration.h:112
The method class provides several meta information about a method and can be invoked.
Definition: method.h:120
uintptr_t type_id
Definition: type.h:173
constexpr bool operator!=(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.
The class template basic_string_view describes an non-owning reference to a constant contiguous seque...
Definition: string_view.h:48
The argument class is used for forwarding arguments to properties or methods.
Definition: argument.h:51
The property class provides several meta information about a property and gives read/write access to ...
Definition: property.h:116
The variant class allows to store data of any type and convert between these types transparently...
Definition: variant.h:197
Target_Type rttr_cast(Source_Type object) noexcept
Casts the given object of type Source_Type to an object of type Target_Type.
The constructor class provides several meta information about a constructor and can be invoked...
Definition: constructor.h:88
constexpr bool operator>(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.
constexpr bool operator<(basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs) noexcept
Compares the two views lhs and rhs.