refl-cpp
refl::runtime::proxy< Derived, Target > Struct Template Reference

A proxy object that has a static interface identical to the reflected functions and fields of the target. More...

#include <refl.hpp>

Public Types

typedef Target target_type
 

Public Member Functions

constexpr proxy () noexcept
 

Detailed Description

template<typename Derived, typename Target>
struct refl::runtime::proxy< Derived, Target >

A proxy object that has a static interface identical to the reflected functions and fields of the target.

A proxy object that has a static interface identical to the reflected functions and fields of the target. Users should inherit from this class and specify an invoke_impl(Member member, Args&&... args) function.

Examples:

template <typename T>
struct dummy_proxy : refl::runtime::proxy<dummy_proxy<T>, T> {
template <typename Member, typename Self, typename... Args>
static int invoke_impl(Self&& self, Args&&... args) {
std::cout << get_debug_name(Member()) << " called with " << sizeof...(Args) << " parameters!\n";
return 0;
}
};

Member Typedef Documentation

◆ target_type

template<typename Derived , typename Target >
typedef Target refl::runtime::proxy< Derived, Target >::target_type

Constructor & Destructor Documentation

◆ proxy()

template<typename Derived , typename Target >
constexpr refl::runtime::proxy< Derived, Target >::proxy ( )
inlineconstexprnoexcept

The documentation for this struct was generated from the following file:
refl::descriptor::get_debug_name
const char * get_debug_name(MemberDescriptor d)
Returns the debug name of T.
Definition: refl.hpp:3266
refl::runtime::proxy
A proxy object that has a static interface identical to the reflected functions and fields of the tar...
Definition: refl.hpp:3835