#include </builds/ipbus/ipbus-software/uhal/python/pybind11-python2/include/pybind11/pytypes.h>
Public Member Functions | |
memoryview (const buffer_info &info) | |
\rst Creates memoryview from buffer_info . More... | |
memoryview (const buffer_info &info) | |
\rst Creates memoryview from buffer_info . More... | |
![]() | |
object ()=default | |
PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h | |
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 () | |
Destructor; automatically calls handle::dec_ref() More... | |
handle | release () |
\rst Resets the internal pointer to nullptr without decreasing the object's reference count. More... | |
object & | operator= (const object &other) |
object & | operator= (object &&other) noexcept |
template<typename T > | |
T | cast () const & |
template<typename T > | |
T | cast () && |
object (handle h, borrowed_t) | |
object (handle h, stolen_t) | |
object ()=default | |
PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h | |
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 () | |
Destructor; automatically calls handle::dec_ref() More... | |
handle | release () |
\rst Resets the internal pointer to nullptr without decreasing the object's reference count. More... | |
object & | operator= (const object &other) |
object & | operator= (object &&other) noexcept |
template<typename T > | |
T | cast () const & |
template<typename T > | |
T | cast () && |
object (handle h, borrowed_t) | |
object (handle h, stolen_t) | |
template<typename T > | |
T | cast () const & |
template<typename T > | |
T | cast () && |
template<> | |
void | cast () const & |
template<> | |
void | cast () && |
![]() | |
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... | |
PyObject * | ptr () const |
Return the underlying PyObject * pointer. More... | |
PyObject *& | ptr () |
const handle & | inc_ref () const & |
\rst Manually increase the reference count of the Python object. More... | |
const handle & | dec_ref () const & |
\rst Manually decrease the reference count of the Python object. More... | |
template<typename T > | |
T | cast () const |
\rst Attempt to cast the Python object into the given C++ type. More... | |
operator bool () const | |
Return true when the handle wraps a valid Python object. More... | |
bool | operator== (const handle &h) const |
\rst Deprecated: Check that the underlying pointers are the same. More... | |
bool | operator!= (const handle &h) const |
bool | check () const |
handle ()=default | |
The default constructor creates a handle with a nullptr -valued pointer. More... | |
template<typename T , detail::enable_if_t< detail::is_pyobj_ptr_or_nullptr_t< T >::value, int > = 0> | |
handle (T ptr) | |
Enable implicit conversion from PyObject * and nullptr . 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... | |
PyObject * | ptr () const |
Return the underlying PyObject * pointer. More... | |
PyObject *& | ptr () |
const handle & | inc_ref () const & |
\rst Manually increase the reference count of the Python object. More... | |
const handle & | dec_ref () const & |
\rst Manually decrease the reference count of the Python object. More... | |
template<typename T > | |
T | cast () const |
\rst Attempt to cast the Python object into the given C++ type. More... | |
operator bool () const | |
Return true when the handle wraps a valid Python object. More... | |
bool | operator== (const handle &h) const |
\rst Deprecated: Check that the underlying pointers are the same. More... | |
bool | operator!= (const handle &h) const |
bool | check () const |
template<> | |
void | cast () const |
Static Public Member Functions | |
static memoryview | from_buffer (void *ptr, ssize_t itemsize, const char *format, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides, bool readonly=false) |
\rst Creates memoryview from static buffer. More... | |
static memoryview | from_buffer (const void *ptr, ssize_t itemsize, const char *format, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides) |
template<typename T > | |
static memoryview | from_buffer (T *ptr, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides, bool readonly=false) |
template<typename T > | |
static memoryview | from_buffer (const T *ptr, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides) |
static memoryview | from_buffer (void *ptr, ssize_t itemsize, const char *format, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides, bool readonly=false) |
\rst Creates memoryview from static buffer. More... | |
static memoryview | from_buffer (const void *ptr, ssize_t itemsize, const char *format, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides) |
template<typename T > | |
static memoryview | from_buffer (T *ptr, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides, bool readonly=false) |
template<typename T > | |
static memoryview | from_buffer (const T *ptr, detail::any_container< ssize_t > shape, detail::any_container< ssize_t > strides) |
static memoryview | from_memory (void *mem, ssize_t size, bool readonly=false) |
\rst Creates memoryview from static memory. More... | |
static memoryview | from_memory (const void *mem, ssize_t size) |
![]() | |
static std::size_t | inc_ref_counter () |
Additional Inherited Members | |
![]() | |
bool | is_borrowed: handle(h) { if (is_borrowed) { inc_ref() |
![]() | |
PyObject * | m_ptr = nullptr |
|
inlineexplicit |
\rst Creates memoryview
from buffer_info
.
buffer_info
must be created from buffer::request()
. Otherwise throws an exception.
For creating a memoryview
from objects that support buffer protocol, use memoryview(const object& obj)
instead of this constructor. \endrst
Definition at line 1853 of file pytypes.h.
References handle::m_ptr, and pybind11_fail().
|
inlineexplicit |
\rst Creates memoryview
from buffer_info
.
buffer_info
must be created from buffer::request()
. Otherwise throws an exception.
For creating a memoryview
from objects that support buffer protocol, use memoryview(const object& obj)
instead of this constructor. \endrst
Definition at line 2184 of file pytypes.h.
References handle::m_ptr, and pybind11_fail().
|
inlinestatic |
Definition at line 1919 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
inlinestatic |
Definition at line 2250 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
inlinestatic |
Definition at line 1896 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
inlinestatic |
Definition at line 2227 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
inlinestatic |
Definition at line 1906 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
inlinestatic |
Definition at line 2237 of file pytypes.h.
References from_buffer(), and handle::ptr().
|
static |
\rst Creates memoryview
from static buffer.
This method is meant for providing a memoryview
for C/C++ buffer not managed by Python. The caller is responsible for managing the lifetime of ptr
and format
, which MUST outlive the memoryview constructed here.
See also: Python C API documentation for PyMemoryView_FromBuffer
_.
.. _PyMemoryView_FromBuffer: https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromBuffer
:param ptr: Pointer to the buffer. :param itemsize: Byte size of an element. :param format: Pointer to the null-terminated format string. For homogeneous Buffers, this should be set to format_descriptor<T>::value
. :param shape: Shape of the tensor (1 entry per dimension). :param strides: Number of bytes between adjacent entries (for each per dimension). :param readonly: Flag to indicate if the underlying storage may be written to. \endrst
Referenced by from_buffer().
|
static |
\rst Creates memoryview
from static buffer.
This method is meant for providing a memoryview
for C/C++ buffer not managed by Python. The caller is responsible for managing the lifetime of ptr
and format
, which MUST outlive the memoryview constructed here.
See also: Python C API documentation for PyMemoryView_FromBuffer
_.
.. _PyMemoryView_FromBuffer: https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromBuffer
:param ptr: Pointer to the buffer. :param itemsize: Byte size of an element. :param format: Pointer to the null-terminated format string. For homogeneous Buffers, this should be set to format_descriptor<T>::value
. :param shape: Shape of the tensor (1 entry per dimension). :param strides: Number of bytes between adjacent entries (for each per dimension). :param readonly: Flag to indicate if the underlying storage may be written to. \endrst
|
inlinestatic |
Definition at line 2278 of file pytypes.h.
References from_memory().
|
inlinestatic |
\rst Creates memoryview
from static memory.
This method is meant for providing a memoryview
for C/C++ buffer not managed by Python. The caller is responsible for managing the lifetime of mem
, which MUST outlive the memoryview constructed here.
See also: Python C API documentation for PyMemoryView_FromBuffer
_.
.. _PyMemoryView_FromMemory: https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromMemory \endrst
Definition at line 2269 of file pytypes.h.
References handle::ptr(), and pybind11_fail().
Referenced by from_memory().