AbstractMappable Class

Inheritance diagram of AbstractMappable

class AbstractMappable

Methods:

get_region(start, size, ptr_type) Map a region of the buffer into a ctypes array of the desired type.

Methods

AbstractMappable.get_region(start, size, ptr_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:
  • start (int) – Offset into the buffer to map from, in bytes
  • size (int) – Size of the buffer region to map, in bytes
  • ptr_type (ctypes pointer type) – Pointer type describing the array format to create
Return type:

AbstractBufferRegion

Table Of Contents

Previous topic

AbstractBufferRegion Class

Next topic

IndirectArrayRegion Class