class _ctypes: (source)
Undocumented
Method | __init__ |
Undocumented |
Method | data |
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: ... |
Method | get |
Deprecated getter for the _ctypes._as_parameter_ property. |
Method | get |
Deprecated getter for the _ctypes.data property. |
Method | get |
Deprecated getter for the _ctypes.shape property. |
Method | get |
Deprecated getter for the _ctypes.strides property. |
Method | shape |
Return the shape tuple as an array of some other c-types type. For example: self.shape_as(ctypes.c_short). |
Method | strides |
Return the strides tuple as an array of some other c-types type. For example: self.strides_as(ctypes.c_longlong). |
Property | data |
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... |
Property | shape |
A ctypes array of length self.ndim where the basetype is the C-integer corresponding to dtype('p') on this platform (see ~numpy.ctypeslib.c_intp ). This base-type could be ctypes.c_int , ctypes.c_long , or ... |
Property | strides |
A ctypes array of length self.ndim where the basetype is the same as for the shape attribute. This ctypes array contains the strides information from the underlying array. This strides information is important for showing how many bytes must be jumped to get to the next element in the array. |
Instance Variable | _arr |
Undocumented |
Instance Variable | _ctypes |
Undocumented |
Instance Variable | _data |
Undocumented |
Instance Variable | _zerod |
Undocumented |
Property | _as |
Overrides the ctypes semi-magic method |
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.
Return the shape tuple as an array of some other c-types type. For example: self.shape_as(ctypes.c_short).
Return the strides tuple as an array of some other c-types type. For example: self.strides_as(ctypes.c_longlong).
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)
A ctypes array of length self.ndim where
the basetype is the C-integer corresponding to dtype('p') on this
platform (see ~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.