Wraps an arbitrary C++ function/method/lambda function/.. into a callable Python object.
More...
|
| cpp_function ()=default |
|
| cpp_function (std::nullptr_t) |
|
template<typename Return , typename... Args, typename... Extra> |
| cpp_function (Return(*f)(Args...), const Extra &...extra) |
| Construct a cpp_function from a vanilla function pointer. More...
|
|
template<typename Func , typename... Extra, typename = detail::enable_if_t<detail::is_lambda<Func>::value>> |
| cpp_function (Func &&f, const Extra &...extra) |
| Construct a cpp_function from a lambda function (possibly with internal state) More...
|
|
template<typename Return , typename Class , typename... Arg, typename... Extra> |
| cpp_function (Return(Class::*f)(Arg...), const Extra &...extra) |
| Construct a cpp_function from a class method (non-const, no ref-qualifier) More...
|
|
template<typename Return , typename Class , typename... Arg, typename... Extra> |
| cpp_function (Return(Class::*f)(Arg...)&, const Extra &...extra) |
|
template<typename Return , typename Class , typename... Arg, typename... Extra> |
| cpp_function (Return(Class::*f)(Arg...) const, const Extra &...extra) |
| Construct a cpp_function from a class method (const, no ref-qualifier) More...
|
|
template<typename Return , typename Class , typename... Arg, typename... Extra> |
| cpp_function (Return(Class::*f)(Arg...) const &, const Extra &...extra) |
|
object | name () const |
| Return the function name. More...
|
|
handle | cpp_function () const |
|
bool | is_cpp_function () const |
|
template<typename T > |
T | cast () const & |
|
template<typename T > |
T | cast ()&& |
|
template<> |
void | cast () const & |
|
template<> |
void | cast ()&& |
|
| object ()=default |
|
| object (const object &o) |
| Copy constructor; always increases the reference count. More...
|
|
| object (object &&other) noexcept |
| Move constructor; steals the object from other and preserves its reference count. More...
|
|
| object (handle h, borrowed_t) |
|
| object (handle h, stolen_t) |
|
object & | operator= (const object &other) |
|
object & | operator= (object &&other) noexcept |
|
| PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h |
|
handle | release () |
|
| ~object () |
| Destructor; automatically calls handle::dec_ref() More...
|
|
Public Member Functions inherited from handle |
template<typename T > |
T | cast () const |
|
template<> |
void | cast () const |
|
bool | check () const |
|
const handle & | dec_ref () const & |
|
| handle ()=default |
| The default constructor creates a handle with a nullptr -valued pointer. More...
|
|
| handle (PyObject *ptr) |
| Creates a handle from the given raw Python object pointer. More...
|
|
const handle & | inc_ref () const & |
|
| operator bool () const |
| Return true when the handle wraps a valid Python object. More...
|
|
bool | operator!= (const handle &h) const |
|
bool | operator== (const handle &h) const |
|
PyObject * | ptr () const |
| Return the underlying PyObject * pointer. More...
|
|
PyObject *& | ptr () |
|
|
template<typename Func , typename Return , typename... Args, typename... Extra> |
void | initialize (Func &&f, Return(*)(Args...), const Extra &...extra) |
| Special internal constructor for functors, lambda functions, etc. More...
|
|
void | initialize_generic (detail::function_record *rec, const char *text, const std::type_info *const *types, size_t args) |
| Register a function call with Python (generic non-templated code goes here) More...
|
|
PYBIND11_NOINLINE detail::function_record * | make_function_record () |
| Space optimization: don't inline this frequently instantiated fragment. More...
|
|
Wraps an arbitrary C++ function/method/lambda function/.. into a callable Python object.
Definition at line 56 of file pybind11.h.
template<typename Return , typename Class , typename... Arg, typename... Extra>
cpp_function::cpp_function |
( |
Return(Class::*)(Arg...) |
f, |
|
|
const Extra &... |
extra |
|
) |
| |
|
inline |
template<typename Return , typename Class , typename... Arg, typename... Extra>
cpp_function::cpp_function |
( |
Return(Class::*)(Arg...) f & |
, |
|
|
const Extra &... |
extra |
|
) |
| |
|
inline |
Construct a cpp_function from a class method (non-const, lvalue ref-qualifier) A copy of the overload for non-const functions without explicit ref-qualifier but with an added &
.
Definition at line 86 of file pybind11.h.
template<typename Return , typename Class , typename... Arg, typename... Extra>
cpp_function::cpp_function |
( |
Return(Class::*)(Arg...) const |
f, |
|
|
const Extra &... |
extra |
|
) |
| |
|
inline |
template<typename Return , typename Class , typename... Arg, typename... Extra>
cpp_function::cpp_function |
( |
Return(Class::*)(Arg...) const f & |
, |
|
|
const Extra &... |
extra |
|
) |
| |
|
inline |
Construct a cpp_function from a class method (const, lvalue ref-qualifier) A copy of the overload for const functions without explicit ref-qualifier but with an added &
.
Definition at line 102 of file pybind11.h.
template<typename Func , typename Return , typename... Args, typename... Extra>
void cpp_function::initialize |
( |
Func && |
f, |
|
|
Return(*)(Args...) |
, |
|
|
const Extra &... |
extra |
|
) |
| |
|
inlineprotected |
Special internal constructor for functors, lambda functions, etc.
Definition at line 118 of file pybind11.h.