refl-cpp
refl::descriptor Namespace Reference

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 member_list = decltype(detail::enumerate_members< T >(std::make_index_sequence< refl_impl::metadata::type_info__< T >::member_count >{}))
 

Functions

template<typename T >
constexpr bool is_field (const T) noexcept
 
template<typename T >
constexpr bool is_function (const T) noexcept
 
template<typename T >
constexpr bool is_type (const T) noexcept
 
template<typename A , typename T >
constexpr bool has_attribute (const T) noexcept
 
template<typename A , typename T >
constexpr const A & get_attribute (const T t) noexcept
 
template<template< typename... > typename A, typename T >
constexpr const auto & get_attribute (const T t) noexcept
 
template<typename T >
constexpr bool is_property (const T t) noexcept
 
template<typename T >
constexpr attr::property get_property (const T t) noexcept
 
template<typename T >
constexpr bool is_readable (const T) noexcept
 
template<typename T >
constexpr bool is_writable (const T) noexcept
 
template<typename T >
constexpr auto has_bases (const T t) noexcept
 
template<typename T >
constexpr auto get_bases (const T t) noexcept
 
template<typename T >
const char * get_debug_name (const T &t)
 
template<typename T >
const char * get_display_name (const T &t) noexcept
 

Detailed Description

Contains the basic reflection primitives as well as functions operating on those primitives.

Typedef Documentation

◆ member_list

template<typename T >
using refl::descriptor::member_list = typedef decltype(detail::enumerate_members<T>(std::make_index_sequence<refl_impl::metadata::type_info__<T>::member_count>{}))

A type_list of the member descriptors of the target type T.

Function Documentation

◆ get_attribute() [1/2]

template<typename A , typename T >
constexpr const A& refl::descriptor::get_attribute ( const T  t)
constexprnoexcept

Returns the value of the attribute A on T.

◆ get_attribute() [2/2]

template<template< typename... > typename A, typename T >
constexpr const auto& refl::descriptor::get_attribute ( const T  t)
constexprnoexcept

Returns the value of the attribute A on T.

◆ get_bases()

template<typename T >
constexpr auto refl::descriptor::get_bases ( const T  t)
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.

See also
refl::attr::bases
refl::descriptor::has_bases

◆ get_debug_name()

template<typename T >
const char* refl::descriptor::get_debug_name ( const T &  t)

Returns the debug name of T. (In the form of 'declaring_type::member_name').

◆ get_display_name()

template<typename T >
const char* refl::descriptor::get_display_name ( const T &  t)
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.

◆ get_property()

template<typename T >
constexpr attr::property refl::descriptor::get_property ( const T  t)
constexprnoexcept

Gets the property attribute.

See also
refl::attr::property
refl::descriptor::is_property

◆ has_attribute()

template<typename A , typename T >
constexpr bool refl::descriptor::has_attribute ( const  T)
constexprnoexcept

Checks whether T has an attribute of type A.

Checks whether T has an attribute of that is a template instance of A.

◆ has_bases()

template<typename T >
constexpr auto refl::descriptor::has_bases ( const T  t)
constexprnoexcept

Checks if a type has a bases attribute.

See also
refl::attr::bases
refl::descriptor::get_bases

◆ is_field()

template<typename T >
constexpr bool refl::descriptor::is_field ( const  T)
constexprnoexcept

Checks whether T is a field descriptor.

See also
refl::descriptor::field_descriptor

◆ is_function()

template<typename T >
constexpr bool refl::descriptor::is_function ( const  T)
constexprnoexcept

Checks whether T is a function descriptor.

See also
refl::descriptor::function_descriptor

◆ is_property()

template<typename T >
constexpr bool refl::descriptor::is_property ( const T  t)
constexprnoexcept

Checks whether T is a member descriptor marked with the property attribute.

See also
refl::attr::property
refl::descriptor::get_property

◆ is_readable()

template<typename T >
constexpr bool refl::descriptor::is_readable ( const  T)
constexprnoexcept

Checks if T is a readable property or a field.

◆ is_type()

template<typename T >
constexpr bool refl::descriptor::is_type ( const  T)
constexprnoexcept

Checks whether T is a type descriptor.

See also
refl::descriptor::type_descriptor

◆ is_writable()

template<typename T >
constexpr bool refl::descriptor::is_writable ( const  T)
constexprnoexcept

Checks if T is a writable property or a non-const field.