Methods:
get_region(start, size, ptr_type) Map a region of the buffer into a ctypes array of the desired type.
Map a region of the buffer into a ctypes array of the desired type. This region does not need to be unmapped, but will become invalid if the buffer is resized.
Note that although a pointer type is required, an array is mapped. For example:
get_region(0, ctypes.sizeof(c_int) * 20, ctypes.POINTER(c_int * 20))
will map bytes 0 to 80 of the buffer to an array of 20 ints.
Changes to the array may not be recognised until the region’s AbstractBufferRegion.invalidate method is called.
Parameters: |
|
---|---|
Return type: | AbstractBufferRegion |