class _ctypes:
Undocumented
Method | __init__ |
Undocumented |
Method | data_as |
No summary |
Method | get_as_parameter |
Deprecated getter for the _ctypes._as_parameter_ property. |
Method | get_data |
Deprecated getter for the _ctypes.data property. |
Method | get_shape |
Deprecated getter for the _ctypes.shape property. |
Method | get_strides |
Deprecated getter for the _ctypes.strides property. |
Method | shape_as |
Return the shape tuple as an array of some other c-types type. For example: self.shape_as(ctypes.c_short). |
Method | strides_as |
Return the strides tuple as an array of some other c-types type. For example: self.strides_as(ctypes.c_longlong). |
Instance Variable | _arr |
Undocumented |
Instance Variable | _ctypes |
Undocumented |
Instance Variable | _data |
Undocumented |
Instance Variable | _zerod |
Undocumented |
Property | _as_parameter_ |
Overrides the ctypes semi-magic method |
Property | data |
No summary |
Property | shape |
No summary |
Property | strides |
No summary |
Return the data pointer cast to a particular c-types object. For example, calling self._as_parameter_ is equivalent to self.data_as(ctypes.c_void_p). Perhaps you want to use the data as a pointer to a ctypes array of floating-point data: self.data_as(ctypes.POINTER(ctypes.c_double)).
The returned pointer will keep a reference to the array.
Deprecated getter for the _ctypes._as_parameter_
property.
Deprecated getter for the _ctypes.shape
property.
Deprecated getter for the _ctypes.strides
property.
A pointer to the memory area of the array as a Python integer. This memory area may contain data that is not aligned, or not in correct byte-order. The memory area may not even be writeable. The array flags and data-type of this array should be respected when passing this attribute to arbitrary C-code to avoid trouble that can include Python crashing. User Beware! The value of this attribute is exactly the same as self._array_interface_['data'][0].
Note that unlike data_as, a reference will not be kept to the array: code like ctypes.c_void_p((a + b).ctypes.data) will result in a pointer to a deallocated array, and should be spelt (a + b).ctypes.data_as(ctypes.c_void_p)
~numpy.ctypeslib.c_intp
). This base-type could be
ctypes.c_int
, ctypes.c_long
, or ctypes.c_longlong
depending on
the platform. The ctypes array contains the shape of
the underlying array.