Contains the basic reflection primitives as well as functions operating on those primitives. More...
Classes | |
class | field_descriptor |
Represents a reflected field. More... | |
class | function_descriptor |
Represents a reflected function. More... | |
class | member_descriptor_base |
The base type for member descriptors. More... | |
class | type_descriptor |
Represents a reflected type. More... | |
Typedefs | |
template<typename T > | |
using | declared_member_list = typename detail::declared_member_list< T >::type |
A type_list of the declared member descriptors of the target type T. More... | |
template<typename T > | |
using | member_list = typename detail::member_list< T >::type |
A type_list of the declared and inherited member descriptors of the target type T. More... | |
template<typename FunctionDescriptor , typename... Args> | |
using | result_type = typename FunctionDescriptor::template result_type< Args... > |
The return type when invoking the specified descriptor using the provided argument types. More... | |
Functions | |
template<typename Descriptor > | |
constexpr auto | get_name (Descriptor d) noexcept |
Returns the full name of the descriptor. More... | |
template<typename Descriptor > | |
constexpr const auto & | get_attributes (Descriptor d) noexcept |
Returns a const reference to the descriptor's attribute tuple. More... | |
template<typename Descriptor > | |
constexpr auto | get_attribute_types (Descriptor d) noexcept |
Returns a type_list of the descriptor's attribute types. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_declared_base_types (TypeDescriptor t) noexcept |
Returns a type_list of the declared base types of the type. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_base_types (TypeDescriptor t) noexcept |
Returns a type_list of the declared and inherited base types of the type. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_declared_members (TypeDescriptor t) noexcept |
Returns a type_list of the declared members of the type. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_members (TypeDescriptor t) noexcept |
Returns a type_list of the declared and inherited members of the type. More... | |
template<typename MemberDescriptor > | |
constexpr auto | get_declarator (MemberDescriptor d) noexcept |
Returns the type_descriptor of declaring type of the member. More... | |
template<typename MemberDescriptor > | |
constexpr auto | get_pointer (MemberDescriptor d) noexcept |
Returns a pointer to the reflected field/function. More... | |
template<typename MemberDescriptor , typename... Args> | |
constexpr auto | invoke (MemberDescriptor d, Args &&... args) noexcept -> decltype(d(std::forward< Args >(args)...)) |
Invokes the member with the specified arguments. More... | |
template<typename FieldDescriptor > | |
constexpr auto | is_static (FieldDescriptor d) noexcept |
Checks whether the field is declared as static. More... | |
template<typename FieldDescriptor > | |
constexpr auto | is_const (FieldDescriptor d) noexcept |
Checks whether the value type of the field is const-qualified. More... | |
template<typename FunctionDescriptor > | |
constexpr auto | is_resolved (FunctionDescriptor d) noexcept |
Checks whether the function pointer was automatically resolved. More... | |
template<typename Pointer , typename FunctionDescriptor > | |
constexpr auto | can_resolve (FunctionDescriptor d) noexcept |
Checks whether the function pointer can be resolved as a pointer of the specified type. More... | |
template<typename Pointer , typename FunctionDescriptor > | |
constexpr auto | resolve (FunctionDescriptor d) noexcept |
Resolves the function pointer as a pointer of the specified type. More... | |
template<typename Descriptor > | |
constexpr bool | is_field (Descriptor) noexcept |
Checks whether T is a field descriptor. More... | |
template<typename Descriptor > | |
constexpr bool | is_function (Descriptor) noexcept |
Checks whether T is a function descriptor. More... | |
template<typename Descriptor > | |
constexpr bool | is_type (Descriptor) noexcept |
Checks whether T is a type descriptor. More... | |
template<typename A , typename Descriptor > | |
constexpr bool | has_attribute (Descriptor) noexcept |
Checks whether T has an attribute of type A. More... | |
template<typename A , typename Descriptor > | |
constexpr const A & | get_attribute (Descriptor d) noexcept |
Returns the value of the attribute A on T. More... | |
template<template< typename... > typename A, typename Descriptor > | |
constexpr const auto & | get_attribute (Descriptor d) noexcept |
Returns the value of the attribute A on T. More... | |
template<typename MemberDescriptor > | |
constexpr bool | is_property (MemberDescriptor d) noexcept |
Checks whether T is a member descriptor marked with the property attribute. More... | |
template<typename FunctionDescriptor > | |
constexpr attr::property | get_property (FunctionDescriptor d) noexcept |
Gets the property attribute. More... | |
template<typename MemberDescriptor > | |
constexpr bool | is_readable (MemberDescriptor) noexcept |
Checks if T is a 0-arg const-qualified member function with a property attribute or a field. More... | |
template<typename MemberDescriptor > | |
constexpr bool | is_writable (MemberDescriptor) noexcept |
Checks if T is a 1-arg non-const-qualified member function with a property attribute or a non-const field. More... | |
template<typename TypeDescriptor > | |
constexpr auto | has_bases (TypeDescriptor t) noexcept |
Checks if a type has a bases attribute. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_bases (TypeDescriptor t) noexcept |
Returns a list of the type_descriptor<T>s of the base types of the target, as specified by the bases<A, B, ...> attribute. More... | |
template<typename TypeDescriptor > | |
constexpr auto | get_simple_name (TypeDescriptor t) |
Returns the unqualified name of the type, discarding the namespace and typenames (if a template type). More... | |
template<typename MemberDescriptor > | |
constexpr auto | get_debug_name_const (MemberDescriptor d) |
Returns the debug name of T (In the form of 'declaring_type::member_name') as a const_string. More... | |
template<typename MemberDescriptor > | |
const char * | get_debug_name (MemberDescriptor d) |
Returns the debug name of T. More... | |
template<typename Descriptor > | |
const char * | get_display_name (Descriptor d) noexcept |
Returns the display name of T. More... | |
template<typename Descriptor > | |
constexpr auto | get_display_name_const (Descriptor d) noexcept |
Returns the display name of T as a const_string<N>. More... | |
template<typename ReadableMember > | |
constexpr bool | has_writer (ReadableMember member) |
Checks if there exists a member that has the same display name as the one provied and is writable. More... | |
template<typename WritableMember > | |
constexpr bool | has_reader (WritableMember member) |
Checks if there exists a member that has the same display name as the one provied and is readable. More... | |
template<typename ReadableMember > | |
constexpr auto | get_writer (ReadableMember member) |
Returns a member that has the same display name as the one provied and is writable. More... | |
template<typename WritableMember > | |
constexpr auto | get_reader (WritableMember member) |
Returns a member that has the same display name as the one provied and is readable. More... | |
Contains the basic reflection primitives as well as functions operating on those primitives.
using refl::descriptor::declared_member_list = typedef typename detail::declared_member_list<T>::type |
A type_list of the declared member descriptors of the target type T.
using refl::descriptor::member_list = typedef typename detail::member_list<T>::type |
A type_list of the declared and inherited member descriptors of the target type T.
using refl::descriptor::result_type = typedef typename FunctionDescriptor::template result_type<Args...> |
The return type when invoking the specified descriptor using the provided argument types.
Argument coversion will be applied as per C++ rules.
|
constexprnoexcept |
Checks whether the function pointer can be resolved as a pointer of the specified type.
|
constexprnoexcept |
Returns the value of the attribute A on T.
|
constexprnoexcept |
Returns the value of the attribute A on T.
|
constexprnoexcept |
Returns a type_list of the descriptor's attribute types.
|
constexprnoexcept |
Returns a const reference to the descriptor's attribute tuple.
|
constexprnoexcept |
Returns a type_list of the declared and inherited base types of the type.
Combine with reflect_types to obtain type_descriptors for those types.
|
constexprnoexcept |
Returns a list of the type_descriptor<T>s of the base types of the target, as specified by the bases<A, B, ...> attribute.
const char* refl::descriptor::get_debug_name | ( | MemberDescriptor | d | ) |
Returns the debug name of T.
(In the form of 'declaring_type::member_name').
|
constexpr |
Returns the debug name of T (In the form of 'declaring_type::member_name') as a const_string.
|
constexprnoexcept |
Returns the type_descriptor of declaring type of the member.
|
constexprnoexcept |
Returns a type_list of the declared base types of the type.
Combine with reflect_types to obtain type_descriptors for those types.
|
constexprnoexcept |
Returns a type_list of the declared members of the type.
|
noexcept |
Returns the display name of T.
Uses the friendly_name of the property attribute, or the normalized name if no friendly_name was provided.
|
constexprnoexcept |
Returns the display name of T as a const_string<N>.
Uses the friendly_name of the property attribute, or the normalized name if no friendly_name was provided.
|
constexprnoexcept |
Returns a type_list of the declared and inherited members of the type.
|
constexprnoexcept |
|
constexprnoexcept |
Returns a pointer to the reflected field/function.
When the member is a function, the return value might be nullptr if the type of the function pointer cannot be resolved.
|
constexprnoexcept |
Gets the property attribute.
|
constexpr |
Returns a member that has the same display name as the one provied and is readable.
For setter methods with a property attribute, the return value will be a reflected getter method with a property with the same display name (property name normalization applies automatically). For fields, returns the same descriptor.
|
constexpr |
Returns the unqualified name of the type, discarding the namespace and typenames (if a template type).
|
constexpr |
Returns a member that has the same display name as the one provied and is writable.
For getter methods with a property attribute, the return value will the reflected setter method with a property with the same display name (property name normalization applies automatically). For fields, returns the same descriptor if writable.
|
constexprnoexcept |
Checks whether T has an attribute of type A.
Checks whether T has an attribute of that is a template instance of A.
|
constexprnoexcept |
Checks if a type has a bases attribute.
|
constexpr |
Checks if there exists a member that has the same display name as the one provied and is readable.
For setter methods with a property attribute, the return value will be true if there exists a reflected getter method with a property with the same display name (property name normalization applies automatically). For fields, returns true.
|
constexpr |
Checks if there exists a member that has the same display name as the one provied and is writable.
For getter methods with a property attribute, the return value will be true if there exists a reflected setter method with a property with the same display name (property name normalization applies automatically). For fields, returns true only if the field is writable.
|
constexprnoexcept |
Invokes the member with the specified arguments.
|
constexprnoexcept |
|
constexprnoexcept |
Checks whether T is a field descriptor.
|
constexprnoexcept |
Checks whether T is a function descriptor.
|
constexprnoexcept |
Checks whether T is a member descriptor marked with the property attribute.
|
constexprnoexcept |
Checks if T is a 0-arg const-qualified member function with a property attribute or a field.
|
constexprnoexcept |
Checks whether the function pointer was automatically resolved.
|
constexprnoexcept |
|
constexprnoexcept |
Checks whether T is a type descriptor.
|
constexprnoexcept |
Checks if T is a 1-arg non-const-qualified member function with a property attribute or a non-const field.
|
constexprnoexcept |
Resolves the function pointer as a pointer of the specified type.