|
| 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...
|
| |
| template<typename T , detail::enable_if_t< detail::all_of< detail::none_of< std::is_base_of< handle, T >, detail::is_pyobj_ptr_or_nullptr_t< T >>, std::is_convertible< T, PyObject * >>::value, int > = 0> |
| | handle (T &obj) |
| | Enable implicit conversion through T::operator PyObject *(). More...
|
| |
| template<typename T , detail::enable_if_t< detail::is_pyobj_ptr_or_nullptr_t< T >::value, int > = 0> |
| | handle (T ptr) |
| |
| 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 () |
| |
| PyObject * | ptr () const |
| | Return the underlying PyObject * pointer. More...
|
| |
\rst Holds a reference to a Python object (no reference counting)
The handle class is a thin wrapper around an arbitrary Python object (i.e. a PyObject * in Python's C API). It does not perform any automatic reference counting and merely provides a basic C++ interface to various Python API functions.
.. seealso:: The object class inherits from handle and adds automatic reference counting features. \endrst
Definition at line 226 of file pytypes.h.
template<typename T , detail::enable_if_t< detail::all_of< detail::none_of< std::is_base_of< handle, T >, detail::is_pyobj_ptr_or_nullptr_t< T >>, std::is_convertible< T, PyObject * >>::value, int > = 0>
| handle::handle |
( |
T & |
obj | ) |
|
|
inline |
Enable implicit conversion through T::operator PyObject *().
Definition at line 247 of file pytypes.h.