refl-cpp |

Public Types | Static Public Attributes | List of all members
refl::descriptor::type_descriptor< T > Class Template Reference

Represents a reflected type. More...

`#include <refl.hpp>`

## Public Types
typedef T | type
| The reflected type T. More...
typedef detail::declared_base_type_list< T >::type | declared_base_types
| The declared base types (via base_types<Ts...> attribute) of T. More...
typedef detail::base_type_list< T >::type | base_types
| The declared and inherited base types of T. More...
typedef declared_member_list< T > | declared_member_types
| A synonym for declared_member_list<T>. More...
typedef member_list< T > | member_types
| A synonym for member_list<T>. More...
typedef detail::attribute_types< T > | attribute_types
| An alias specifying the types of the attributes of the member. More...

## Static Public Attributes
static constexpr declared_base_types | declared_bases {}
| The declared base types (via base_types<Ts...> attribute) of T. More...
static constexpr base_types | bases {}
| The declared and inherited base types of T. More...
static constexpr declared_member_types | declared_members { }
| The list of declared member descriptors. More...
static constexpr member_types | members { }
| The list of declared and inherited member descriptors. More...
static constexpr const auto | name { type_info::name }
| The name of the reflected type. More...
static constexpr const auto | attributes { type_info::attributes }
| The attributes of the reflected type. More...

## Detailed Description

### template<typename T>
class refl::descriptor::type_descriptor< T >

Represents a reflected type.

## Member Typedef Documentation

## ◆ attribute_types

template<typename T >

typedef detail::attribute_types<T> refl::descriptor::type_descriptor< T >::attribute_types

An alias specifying the types of the attributes of the member.

(Removes CV-qualifiers.)

struct Foo {};
REFL_AUTO(type(Foo, bases<>, ns::serializable()))
get_attribute_types(reflect<Foo>()) -> type_list<attr::base_types<>, ns::serializable>

## ◆ base_types

template<typename T >

typedef detail::base_type_list<T>::type refl::descriptor::type_descriptor< T >::base_types

The declared and inherited base types of T.

Combine with reflect_types to obtain type_descriptors for those types.

See also
  reflect_types

struct Animal {};
REFL_AUTO(type(Animal))
struct Mammal : Animal {};
REFL_AUTO(type(Mammal, bases<Animal>))
struct Dog : Mammal {}:
REFL_AUTO(type(Dog, bases<Mammal>))
get_base_types(reflect<Dog>()) -> type_list<Mammal, Animal>

## ◆ declared_base_types

template<typename T >

typedef detail::declared_base_type_list<T>::type refl::descriptor::type_descriptor< T >::declared_base_types

The declared base types (via base_types<Ts...> attribute) of T.

Combine with reflect_types to obtain type_descriptors for those types.

See also
  reflect_types

struct Animal {};
REFL_AUTO(type(Animal))
struct Mammal : Animal {};
REFL_AUTO(type(Mammal, bases<Animal>))
struct Dog : Mammal {}:
REFL_AUTO(type(Dog, bases<Mammal>))
get_base_types(reflect<Dog>()) -> type_list<Mammal>

## ◆ declared_member_types

template<typename T >

typedef declared_member_list<T> refl::descriptor::type_descriptor< T >::declared_member_types

A synonym for declared_member_list<T>.

## ◆ member_types

template<typename T >

typedef member_list<T> refl::descriptor::type_descriptor< T >::member_types

A synonym for member_list<T>.

## ◆ type

template<typename T >

typedef T refl::descriptor::type_descriptor< T >::type

The reflected type T.

struct Foo {};
REFL_AUTO(type(Foo))
type_descriptor<Foo>::type -> Foo

## Member Data Documentation

## ◆ attributes

template<typename T >

constexpr const auto refl::descriptor::type_descriptor< T >::attributes { type_info::attributes }
| static constexpr

The attributes of the reflected type.

struct Foo {};
REFL_AUTO(type(Foo, bases<>, ns::serializable()))
get_attributes(reflect<Foo>()) -> const std::tuple<attr::base_types<>, ns::serializable>&

## ◆ bases

template<typename T >

constexpr base_types refl::descriptor::type_descriptor< T >::bases {}
| static constexpr

The declared and inherited base types of T.

Combine with reflect_types to obtain type_descriptors for those types.

See also
  reflect_types

struct Animal {};
REFL_AUTO(type(Animal))
struct Mammal : Animal {};
REFL_AUTO(type(Mammal, bases<Animal>))
struct Dog : Mammal {}:
REFL_AUTO(type(Dog, bases<Mammal>))
get_base_types(reflect<Dog>()) -> type_list<Mammal, Animal>

## ◆ declared_bases

template<typename T >

constexpr declared_base_types refl::descriptor::type_descriptor< T >::declared_bases {}
| static constexpr

The declared base types (via base_types<Ts...> attribute) of T.

Combine with reflect_types to obtain type_descriptors for those types.

See also
  reflect_types

struct Animal {};
REFL_AUTO(type(Animal))
struct Mammal : Animal {};
REFL_AUTO(type(Mammal, bases<Animal>))
struct Dog : Mammal {}:
REFL_AUTO(type(Dog, bases<Mammal>))
get_base_types(reflect<Dog>()) -> type_list<Mammal>

## ◆ declared_members

template<typename T >

constexpr declared_member_types refl::descriptor::type_descriptor< T >::declared_members { }
| static constexpr

The list of declared member descriptors.

struct Base {
int val;
};
struct Foo : Base {
int bar, baz;
};
REFL_AUTO(type(Foo, bases<Base>), field(bar), field(baz))
get_declared_members(reflect<Foo>()) -> type_list<field_descriptor<Foo, 0> /bar/, field_descriptor<Foo, 1> /baz/>

## ◆ members

template<typename T >

constexpr member_types refl::descriptor::type_descriptor< T >::members { }
| static constexpr

The list of declared and inherited member descriptors.

struct Base {
int val;
};
struct Foo : Base {
int bar, baz;
};
REFL_AUTO(type(Foo, bases<Base>), field(bar), field(baz))
get_members(reflect<Foo>()) -> type_list<field_descriptor<Foo, 0> /bar/, field_descriptor<Foo, 1> /baz/, field_descriptor<Base, 0> /val/>

## ◆ name

template<typename T >

constexpr const auto refl::descriptor::type_descriptor< T >::name { type_info::name }
| static constexpr

The name of the reflected type.

namespace ns {
struct Foo {
int x;
};
}
REFL_AUTO(type(ns::Foo), field(x))
get_name(reflect<Foo>()) -> "ns::Foo"
get_name(get_t<0, member_list<Foo>>()) -> "x"

The documentation for this class was generated from the following file:

- include/refl.hpp

refl::descriptor::get_attributes
constexpr const auto & get_attributes(Descriptor d) noexcept
Returns a const reference to the descriptor's attribute tuple.
Definition: refl.hpp:2672
refl::descriptor::type_descriptor::type
T type
The reflected type T.
Definition: refl.hpp:2569
refl::descriptor::get_declared_members
constexpr auto get_declared_members(TypeDescriptor t) noexcept
Returns a type_list of the declared members of the type.
Definition: refl.hpp:2756
refl::descriptor::get_attribute_types
constexpr auto get_attribute_types(Descriptor d) noexcept
Returns a type_list of the descriptor's attribute types.
Definition: refl.hpp:2689
refl::descriptor::get_members
constexpr auto get_members(TypeDescriptor t) noexcept
Returns a type_list of the declared and inherited members of the type.
Definition: refl.hpp:2777
refl::trait::get_t
typename get< N, TypeList >::type get_t
The N-th type in the provided type_list.
Definition: refl.hpp:800
refl::descriptor::get_base_types
constexpr auto get_base_types(TypeDescriptor t) noexcept
Returns a type_list of the declared and inherited base types of the type.
Definition: refl.hpp:2735
refl::reflect
constexpr type_descriptor< T > reflect() noexcept
Returns the type descriptor for the type T.
Definition: refl.hpp:3682
refl::descriptor::type_descriptor::base_types
detail::base_type_list< T >::type base_types
The declared and inherited base types of T.
Definition: refl.hpp:2581
refl::descriptor::get_name
constexpr auto get_name(Descriptor d) noexcept
Returns the full name of the descriptor.
Definition: refl.hpp:2655