#include <pytypes.h>
|
| memoryview (const buffer_info &info) |
|
template<typename T > |
T | cast () && |
|
template<typename T > |
T | cast () const & |
|
template<> |
void | cast () const & |
|
| object ()=default |
|
| object (const object &o) |
| Copy constructor; always increases the reference count. More...
|
|
| object (handle h, borrowed_t) |
|
| object (handle h, stolen_t) |
|
| object (object &&other) noexcept |
| Move constructor; steals the object from other and preserves its reference count. More...
|
|
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...
|
|
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...
|
|
|
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 (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) |
|
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) |
|
static memoryview | from_memory (const void *mem, ssize_t size) |
|
static memoryview | from_memory (void *mem, ssize_t size, bool readonly=false) |
|
Static Public Member Functions inherited from handle |
static std::size_t | inc_ref_counter () |
|
Definition at line 2288 of file pytypes.h.
◆ memoryview()
◆ from_buffer() [1/4]
template<typename T >
static memoryview memoryview::from_buffer |
( |
const T * |
ptr, |
|
|
detail::any_container< ssize_t > |
shape, |
|
|
detail::any_container< ssize_t > |
strides |
|
) |
| |
|
inlinestatic |
◆ from_buffer() [2/4]
static memoryview memoryview::from_buffer |
( |
const void * |
ptr, |
|
|
ssize_t |
itemsize, |
|
|
const char * |
format, |
|
|
detail::any_container< ssize_t > |
shape, |
|
|
detail::any_container< ssize_t > |
strides |
|
) |
| |
|
inlinestatic |
◆ from_buffer() [3/4]
template<typename T >
static memoryview memoryview::from_buffer |
( |
T * |
ptr, |
|
|
detail::any_container< ssize_t > |
shape, |
|
|
detail::any_container< ssize_t > |
strides, |
|
|
bool |
readonly = false |
|
) |
| |
|
inlinestatic |
◆ from_buffer() [4/4]
static memoryview 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 |
|
) |
| |
|
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
◆ from_memory() [1/2]
◆ from_memory() [2/2]
static memoryview memoryview::from_memory |
( |
void * |
mem, |
|
|
ssize_t |
size, |
|
|
bool |
readonly = false |
|
) |
| |
|
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 2386 of file pytypes.h.
The documentation for this class was generated from the following file: