Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
argument_loader< Args > Class Template Reference

Helper class which loads arguments for C++ functions called from Python. More...

#include <cast.h>

Public Member Functions

template<typename Return , typename Guard , typename Func >
enable_if_t<!std::is_void< Return >::value, Return > call (Func &&f)&&
 
template<typename Return , typename Guard , typename Func >
enable_if_t< std::is_void< Return >::value, void_typecall (Func &&f)&&
 
bool load_args (function_call &call)
 

Static Public Attributes

static constexpr auto arg_names = concat(type_descr(make_caster<Args>::name)...)
 
static constexpr bool has_args = args_pos < 0
 
static constexpr bool has_kwargs = kwargs_pos < 0
 

Private Types

template<typename Arg >
using argument_is_args = std::is_same< intrinsic_t< Arg >, args >
 
template<typename Arg >
using argument_is_kwargs = std::is_same< intrinsic_t< Arg >, kwargs >
 
using indices = make_index_sequence< sizeof...(Args)>
 

Private Member Functions

template<typename Return , typename Func , size_t... Is, typename Guard >
Return call_impl (Func &&f, index_sequence< Is... >, Guard &&)&&
 
template<size_t... Is>
bool load_impl_sequence (function_call &call, index_sequence< Is... >)
 

Static Private Member Functions

static bool load_impl_sequence (function_call &, index_sequence<>)
 

Private Attributes

std::tuple< make_caster< Args >... > argcasters
 

Static Private Attributes

static constexpr bool args_kwargs_are_last = kwargs_pos >= - 1 && args_pos >= kwargs_pos - 1
 
static constexpr auto args_pos = constexpr_first<argument_is_args, Args...>() - (int) sizeof...(Args)
 
static constexpr auto kwargs_pos = constexpr_first<argument_is_kwargs, Args...>() - (int) sizeof...(Args)
 

Detailed Description

template<typename... Args>
class argument_loader< Args >

Helper class which loads arguments for C++ functions called from Python.

Definition at line 1966 of file cast.h.

Member Typedef Documentation

template<typename... Args>
template<typename Arg >
using argument_loader< Args >::argument_is_args = std::is_same<intrinsic_t<Arg>, args>
private

Definition at line 1969 of file cast.h.

template<typename... Args>
template<typename Arg >
using argument_loader< Args >::argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>
private

Definition at line 1970 of file cast.h.

template<typename... Args>
using argument_loader< Args >::indices = make_index_sequence<sizeof...(Args)>
private

Definition at line 1967 of file cast.h.

Member Function Documentation

template<typename... Args>
template<typename Return , typename Guard , typename Func >
enable_if_t<!std::is_void<Return>::value, Return> argument_loader< Args >::call ( Func &&  f)
inline

Definition at line 1990 of file cast.h.

template<typename... Args>
template<typename Return , typename Guard , typename Func >
enable_if_t<std::is_void<Return>::value, void_type> argument_loader< Args >::call ( Func &&  f)
inline

Definition at line 1995 of file cast.h.

template<typename... Args>
template<typename Return , typename Func , size_t... Is, typename Guard >
Return argument_loader< Args >::call_impl ( Func &&  f,
index_sequence< Is... >  ,
Guard &&   
)
inlineprivate

Definition at line 2018 of file cast.h.

template<typename... Args>
bool argument_loader< Args >::load_args ( function_call call)
inline

Definition at line 1985 of file cast.h.

template<typename... Args>
static bool argument_loader< Args >::load_impl_sequence ( function_call ,
index_sequence<>   
)
inlinestaticprivate

Definition at line 2002 of file cast.h.

template<typename... Args>
template<size_t... Is>
bool argument_loader< Args >::load_impl_sequence ( function_call call,
index_sequence< Is... >   
)
inlineprivate

Definition at line 2005 of file cast.h.

Member Data Documentation

template<typename... Args>
constexpr auto argument_loader< Args >::arg_names = concat(type_descr(make_caster<Args>::name)...)
static

Definition at line 1983 of file cast.h.

template<typename... Args>
std::tuple<make_caster<Args>...> argument_loader< Args >::argcasters
private

Definition at line 2022 of file cast.h.

template<typename... Args>
constexpr bool argument_loader< Args >::args_kwargs_are_last = kwargs_pos >= - 1 && args_pos >= kwargs_pos - 1
staticprivate

Definition at line 1975 of file cast.h.

template<typename... Args>
constexpr auto argument_loader< Args >::args_pos = constexpr_first<argument_is_args, Args...>() - (int) sizeof...(Args)
staticprivate

Definition at line 1972 of file cast.h.

template<typename... Args>
constexpr bool argument_loader< Args >::has_args = args_pos < 0
static

Definition at line 1981 of file cast.h.

template<typename... Args>
constexpr bool argument_loader< Args >::has_kwargs = kwargs_pos < 0
static

Definition at line 1980 of file cast.h.

template<typename... Args>
constexpr auto argument_loader< Args >::kwargs_pos = constexpr_first<argument_is_kwargs, Args...>() - (int) sizeof...(Args)
staticprivate

Definition at line 1973 of file cast.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:44