#include "detail/common.h"
#include "detail/descr.h"
#include "detail/type_caster_base.h"
#include "detail/typeid.h"
#include "pytypes.h"
#include <array>
#include <cstring>
#include <functional>
#include <iosfwd>
#include <iterator>
#include <memory>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
Go to the source code of this file.
Namespaces | |
literals | |
Macros | |
#define | PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) |
Create a specialization for custom holder types (silently ignores std::shared_ptr) More... | |
#define | PYBIND11_MAKE_OPAQUE(...) |
#define | PYBIND11_TYPE(...) __VA_ARGS__ |
#define | PYBIND11_TYPE_CASTER(type, py_name) |
Typedefs | |
template<typename > | |
using | arg_t = arg_v |
Alias for backward compatibility – to be removed in version 2.0. More... | |
template<typename type > | |
using | cast_is_temporary_value_reference = bool_constant<(std::is_reference< type >::value||std::is_pointer< type >::value) &&!std::is_base_of< type_caster_generic, make_caster< type > >::value &&!std::is_same< intrinsic_t< type >, void >::value > |
template<typename T > | |
using | is_kw_only = std::is_same< intrinsic_t< T >, kw_only > |
template<typename T > | |
using | is_pos_only = std::is_same< intrinsic_t< T >, pos_only > |
template<typename CharT > | |
using | is_std_char_type = any_of< std::is_same< CharT, char >, std::is_same< CharT, char16_t >, std::is_same< CharT, char32_t >, std::is_same< CharT, wchar_t > > |
template<typename type > | |
using | make_caster = type_caster< intrinsic_t< type > > |
template<typename T > | |
using | move_is_plain_type = satisfies_none_of< T, std::is_void, std::is_pointer, std::is_reference, std::is_const > |
template<typename T > | |
using | move_never = none_of< move_always< T >, move_if_unreferenced< T > > |
template<typename ret_type > | |
using | override_caster_t = conditional_t< cast_is_temporary_value_reference< ret_type >::value, make_caster< ret_type >, override_unused > |
template<typename type , typename holder_type > | |
using | type_caster_holder = conditional_t< is_copy_constructible< holder_type >::value, copyable_holder_caster< type, holder_type >, move_only_holder_caster< type, holder_type > > |
Functions | |
template<typename... Args> | |
constexpr bool | args_are_all_positional () |
template<typename T , detail::enable_if_t<!detail::is_pyobject< T >::value &&!detail::is_same_ignoring_cvref< T, PyObject * >::value, int > = 0> | |
T | cast (const handle &handle) |
template<typename T , typename Handle , detail::enable_if_t< detail::is_same_ignoring_cvref< T, PyObject * >::value &&detail::is_same_ignoring_cvref< Handle, handle >::value, int > = 0> | |
T | cast (Handle &&handle) |
template<typename T , typename Object , detail::enable_if_t< detail::is_same_ignoring_cvref< T, PyObject * >::value &&detail::is_same_ignoring_cvref< Object, object >::value, int > = 0> | |
T | cast (Object &&obj) |
template<typename T > | |
detail::enable_if_t<!detail::is_pyobject< T >::value &&detail::move_always< T >::value, T > | cast (object &&object) |
template<typename T > | |
detail::enable_if_t<!detail::is_pyobject< T >::value &&detail::move_if_unreferenced< T >::value, T > | cast (object &&object) |
template<typename T > | |
detail::enable_if_t<!detail::is_pyobject< T >::value &&detail::move_never< T >::value, T > | cast (object &&object) |
template<typename T > | |
detail::enable_if_t< detail::is_pyobject< T >::value, T > | cast (object &&object) |
template<typename T , detail::enable_if_t<!detail::is_pyobject< T >::value, int > = 0> | |
object | cast (T &&value, return_value_policy policy=return_value_policy::automatic_reference, handle parent=handle()) |
cast_error | cast_error_unable_to_convert_call_arg (const std::string &name, const std::string &type) |
template<typename T > | |
make_caster< T >::template cast_op_type< typename std::add_rvalue_reference< T >::type > | cast_op (make_caster< T > &&caster) |
template<typename T > | |
make_caster< T >::template cast_op_type< T > | cast_op (make_caster< T > &caster) |
template<typename T > | |
enable_if_t<!cast_is_temporary_value_reference< T >::value, T > | cast_ref (object &&, override_unused &) |
template<typename T > | |
enable_if_t< cast_is_temporary_value_reference< T >::value, T > | cast_ref (object &&o, make_caster< T > &caster) |
template<typename T > | |
enable_if_t< cast_is_temporary_value_reference< T >::value &&!detail::is_same_ignoring_cvref< T, PyObject * >::value, T > | cast_safe (object &&) |
template<typename T > | |
enable_if_t< std::is_void< T >::value, void > | cast_safe (object &&) |
template<typename T > | |
enable_if_t< detail::is_same_ignoring_cvref< T, PyObject * >::value, PyObject * > | cast_safe (object &&o) |
template<typename T > | |
enable_if_t< detail::none_of< cast_is_temporary_value_reference< T >, detail::is_same_ignoring_cvref< T, PyObject * >, std::is_void< T > >::value, T > | cast_safe (object &&o) |
template<return_value_policy policy, typename... Args, typename = enable_if_t<args_are_all_positional<Args...>()>> | |
simple_collector< policy > | collect_arguments (Args &&...args) |
Collect only positional arguments for a Python function call. More... | |
template<return_value_policy policy, typename... Args, typename = enable_if_t<!args_are_all_positional<Args...>()>> | |
unpacking_collector< policy > | collect_arguments (Args &&...args) |
Collect all arguments, including keywords and unpacking (only instantiated when needed) More... | |
template<typename T > | |
make_caster< T > | load_type (const handle &handle) |
template<typename T , typename SFINAE > | |
type_caster< T, SFINAE > & | load_type (type_caster< T, SFINAE > &conv, const handle &handle) |
template<return_value_policy policy = return_value_policy::automatic_reference> | |
tuple | make_tuple () |
template<return_value_policy policy = return_value_policy::automatic_reference, typename... Args> | |
tuple | make_tuple (Args &&...args_) |
template<typename T > | |
detail::enable_if_t<!detail::move_never< T >::value, T > | move (object &&obj) |
template<typename T , enable_if_t<!is_pyobject< T >::value, int > > | |
object | object_or_cast (T &&o) |
constexpr arg | literals::operator""_a (const char *name, size_t) |
#define PYBIND11_DECLARE_HOLDER_TYPE | ( | type, | |
holder_type, | |||
... | |||
) |
Create a specialization for custom holder types (silently ignores std::shared_ptr)
#define PYBIND11_MAKE_OPAQUE | ( | ... | ) |
#define PYBIND11_TYPE | ( | ... | ) | __VA_ARGS__ |
#define PYBIND11_TYPE_CASTER | ( | type, | |
py_name | |||
) |
using cast_is_temporary_value_reference = bool_constant<(std::is_reference<type>::value || std::is_pointer<type>::value) && !std::is_base_of<type_caster_generic, make_caster<type> >::value && !std::is_same<intrinsic_t<type>, void>::value> |
using is_kw_only = std::is_same<intrinsic_t<T>, kw_only> |
using is_pos_only = std::is_same<intrinsic_t<T>, pos_only> |
using is_std_char_type = any_of<std::is_same<CharT, char>, std::is_same<CharT, char16_t>, std::is_same<CharT, char32_t>, std::is_same<CharT, wchar_t> > |
using make_caster = type_caster<intrinsic_t<type> > |
using move_is_plain_type = satisfies_none_of<T, std::is_void, std::is_pointer, std::is_reference, std::is_const> |
using move_never = none_of<move_always<T>, move_if_unreferenced<T> > |
using override_caster_t = conditional_t<cast_is_temporary_value_reference<ret_type>::value, make_caster<ret_type>, override_unused> |
using type_caster_holder = conditional_t<is_copy_constructible<holder_type>::value, copyable_holder_caster<type, holder_type>, move_only_holder_caster<type, holder_type> > |
|
constexpr |
T cast | ( | Handle && | handle | ) |
detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_always<T>::value, T> cast | ( | object && | object | ) |
detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_if_unreferenced<T>::value, T> cast | ( | object && | object | ) |
detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_never<T>::value, T> cast | ( | object && | object | ) |
detail::enable_if_t<detail::is_pyobject<T>::value, T> cast | ( | object && | object | ) |
object cast | ( | T && | value, |
return_value_policy | policy = return_value_policy::automatic_reference , |
||
handle | parent = handle() |
||
) |
|
inline |
make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type> cast_op | ( | make_caster< T > && | caster | ) |
make_caster<T>::template cast_op_type<T> cast_op | ( | make_caster< T > & | caster | ) |
enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref | ( | object && | , |
override_unused & | |||
) |
enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref | ( | object && | o, |
make_caster< T > & | caster | ||
) |
enable_if_t<cast_is_temporary_value_reference<T>::value && !detail::is_same_ignoring_cvref<T, PyObject *>::value, T> cast_safe | ( | object && | ) |
enable_if_t<std::is_void<T>::value, void> cast_safe | ( | object && | ) |
enable_if_t<detail::is_same_ignoring_cvref<T, PyObject *>::value, PyObject *> cast_safe | ( | object && | o | ) |
enable_if_t<detail::none_of<cast_is_temporary_value_reference<T>, detail::is_same_ignoring_cvref<T, PyObject *>, std::is_void<T> >::value, T> cast_safe | ( | object && | o | ) |
simple_collector<policy> collect_arguments | ( | Args &&... | args | ) |
unpacking_collector<policy> collect_arguments | ( | Args &&... | args | ) |
make_caster<T> load_type | ( | const handle & | handle | ) |
type_caster<T, SFINAE>& load_type | ( | type_caster< T, SFINAE > & | conv, |
const handle & | handle | ||
) |
tuple make_tuple | ( | ) |
tuple make_tuple | ( | Args &&... | args_ | ) |
detail::enable_if_t<!detail::move_never<T>::value, T> move | ( | object && | obj | ) |