Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
CallTraits< F >

#include "jsonipc.hh"

Classes

struct TupleElement
struct TupleElement< INDEX, false >

Public Types

template<size_t INDEX>
usingArgType = typename TupleElement< HAS_THIS+INDEX,(INDEX< N_ARGS)>::Type
usingArguments = typename FunctionTraits< FuncType >::Arguments
template<size_t INDEX>
usingConvertType = decltype(Convert< ArgType< INDEX > >::from_json(std::declval< JsonValue >()))
usingFuncType = typename std::decay< F >::type

Static Public Member Functions

template<size_t INDEX>
static ConvertType< INDEX >arg_from_json (const CallbackInfo &args)
template<typename T , size_t ... INDICES>
static FunctionTraits< F >::ReturnTypecall_unpacked (T &obj, const F &func, const CallbackInfo &args, std::index_sequence< INDICES... >)

Static Public Attributes

static constexpr const boolHAS_THIS
static constexpr const size_tN_ARGS

Detailed Description

template<typename F>
struct Jsonipc::CallTraits< F >

Template class providing conversion helpers for JsonValue to indexed C++ function argument.

Member Typedef Documentation

FuncType

template<typename F >
using FuncType = typename std::decay<F>::type

Arguments

template<typename F >
using Arguments = typename FunctionTraits<FuncType>::Arguments

ArgType

template<typename F >
template<size_t INDEX>
using ArgType = typename TupleElement<HAS_THIS + INDEX, (INDEX < N_ARGS)>::Type

ConvertType

template<typename F >
template<size_t INDEX>
using ConvertType = decltype (Convert<ArgType<INDEX> >::from_json (std::declval<JsonValue>()))

Member Function Documentation

arg_from_json()

template<typename F >
template<size_t INDEX>
static ConvertType< INDEX > arg_from_json ( const CallbackInfo & args)
static

call_unpacked()

template<typename F >
template<typename T , size_t ... INDICES>
static FunctionTraits< F >::ReturnType call_unpacked ( T & obj,
const F & func,
const CallbackInfo & args,
std::index_sequence< INDICES... >
)
static

Member Data Documentation

HAS_THIS

template<typename F >
constexpr const bool HAS_THIS
staticconstexpr

N_ARGS

template<typename F >
constexpr const size_t N_ARGS
staticconstexpr