Scarab  v2.9.1
Project 8 C++ Utility Library
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

bool load_args (function_call &call)
 
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) &&
 

Static Public Attributes

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

Private Types

using indices = make_index_sequence< sizeof...(Args)>
 
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 >
 

Private Member Functions

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

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 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)
 
static constexpr bool args_kwargs_are_last = kwargs_pos >= - 1 && args_pos >= kwargs_pos - 1
 

Detailed Description

template<typename... Args>
class pybind11::detail::argument_loader< Args >

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

Definition at line 1885 of file cast.h.

Member Typedef Documentation

◆ argument_is_args

using argument_is_args = std::is_same<intrinsic_t<Arg>, args>
private

Definition at line 1888 of file cast.h.

◆ argument_is_kwargs

using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>
private

Definition at line 1889 of file cast.h.

◆ indices

using indices = make_index_sequence<sizeof...(Args)>
private

Definition at line 1886 of file cast.h.

Member Function Documentation

◆ call() [1/2]

enable_if_t<!std::is_void<Return>::value, Return> call ( Func &&  f) &&
inline

Definition at line 1909 of file cast.h.

◆ call() [2/2]

enable_if_t<std::is_void<Return>::value, void_type> call ( Func &&  f) &&
inline

Definition at line 1914 of file cast.h.

◆ call_impl()

Return call_impl ( Func &&  f,
index_sequence< Is... >  ,
Guard &&   
)
inlineprivate

Definition at line 1932 of file cast.h.

◆ load_args()

bool load_args ( function_call call)
inline

Definition at line 1904 of file cast.h.

◆ load_impl_sequence() [1/2]

static bool load_impl_sequence ( function_call ,
index_sequence<>   
)
inlinestaticprivate

Definition at line 1921 of file cast.h.

◆ load_impl_sequence() [2/2]

bool load_impl_sequence ( function_call call,
index_sequence< Is... >   
)
inlineprivate

Definition at line 1924 of file cast.h.

Member Data Documentation

◆ arg_names

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

Definition at line 1902 of file cast.h.

◆ argcasters

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

Definition at line 1936 of file cast.h.

◆ args_kwargs_are_last

constexpr bool args_kwargs_are_last = kwargs_pos >= - 1 && args_pos >= kwargs_pos - 1
staticprivate

Definition at line 1894 of file cast.h.

◆ args_pos

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

Definition at line 1891 of file cast.h.

◆ has_args

constexpr bool has_args = args_pos < 0
static

Definition at line 1900 of file cast.h.

◆ has_kwargs

constexpr bool has_kwargs = kwargs_pos < 0
static

Definition at line 1899 of file cast.h.

◆ kwargs_pos

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

Definition at line 1892 of file cast.h.


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