public abstract class Base1DBuffer extends BaseBuffer
BaseBuffer
mostly applies.PyBuffer.Pointer
Modifier and Type | Field and Description |
---|---|
protected static int[] |
ONE
The strides array for a contiguous 1D byte buffer.
|
protected static int[] |
ZERO
The shape array for a zero length 1D buffer.
|
ANY_CONTIGUOUS, AS_ARRAY, C_CONTIGUOUS, CONTIG, CONTIG_RO, CONTIGUITY, F_CONTIGUOUS, FORMAT, FULL, FULL_RO, INDIRECT, IS_C_CONTIGUOUS, IS_F_CONTIGUOUS, MAX_NDIM, NAVIGATION, ND, RECORDS, RECORDS_RO, SIMPLE, STRIDED, STRIDED_RO, STRIDES, WRITABLE
Modifier | Constructor and Description |
---|---|
protected |
Base1DBuffer(int featureFlags,
int index0,
int size,
int stride)
Construct an instance of
Base1DBuffer in support of a sub-class, specifying the
'feature flags', or at least a starting set to be adjusted later. |
protected |
Base1DBuffer(int featureFlags,
int index0,
int size,
int[] strides)
Construct an instance of
Base1DBuffer in support of a sub-class, specifying the
'feature flags', or at least a starting set to be adjusted later. |
Modifier and Type | Method and Description |
---|---|
protected int |
calcGreatestIndex()
Calculate the absolute byte index in the storage array of the last item of the exported data
(if we are not using indirection).
|
protected int |
calcLeastIndex()
Calculate the absolute byte index in the storage array of the first item of the exported data
(if we are not using indirection).
|
int |
getLen()
The total number of bytes represented by the view, which will be the product of the elements
of the
shape array, and the item size in bytes. |
protected int |
getSize() |
boolean |
isContiguous(char order)
Enquire whether the array is represented contiguously in the backing storage, according to C
or Fortran ordering.
|
addFeatureFlags, bufferIsNot, bufferReleased, bufferRequires, byteAt, byteAt, byteAtImpl, byteIndex, byteIndex, checkHasArray, checkRequestFlags, checkWritable, close, copyFrom, copyFrom, copyTo, copyTo, differentStructure, getBuf, getBuffer, getBufferAgain, getBufferSlice, getFeatureFlags, getFormat, getItemsize, getNdim, getNIOByteBuffer, getNIOByteBufferImpl, getObj, getPointer, getPointer, getRoot, getShape, getStrides, getSuboffsets, hasArray, intAt, intAt, isReadonly, isReleased, notWritable, release, releaseAction, removeFeatureFlags, setFeatureFlags, storeAt, storeAt, storeAtImpl, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBufferSlice
protected static final int[] ONE
protected static final int[] ZERO
protected Base1DBuffer(int featureFlags, int index0, int size, int[] strides)
Base1DBuffer
in support of a sub-class, specifying the
'feature flags', or at least a starting set to be adjusted later. Also specify the navigation
( BaseBuffer.index0
, number of elements, and BaseBuffer.strides
array. These 'feature flags' are
the features of the buffer exported, not the flags that form the consumer's request. The
buffer will be read-only unless PyBUF.WRITABLE
is set. PyBUF.FORMAT
is
implicitly added to the feature flags.
To complete initialisation, the sub-class normally must create its own wrapped byte-storage,
and call BaseBuffer.checkRequestFlags(int)
passing the consumer's request flags.
featureFlags
- bit pattern that specifies the features allowedindex0
- index into storage of item[0]
size
- number of elements in the viewstrides
- an array of length 1 providing index stride between successive elementsprotected Base1DBuffer(int featureFlags, int index0, int size, int stride)
Base1DBuffer
in support of a sub-class, specifying the
'feature flags', or at least a starting set to be adjusted later. Also specify the navigation
( BaseBuffer.index0
, number of elements, and byte-index distance from one to the next. These
'feature flags' are the features of the buffer exported, not the flags that form the
consumer's request. The buffer will be read-only unless PyBUF.WRITABLE
is set.
PyBUF.FORMAT
is implicitly added to the feature flags.
To complete initialisation, the sub-class normally must create its own wrapped byte-storage,
and call BaseBuffer.checkRequestFlags(int)
passing the consumer's request flags.
featureFlags
- bit pattern that specifies the features allowedindex0
- index into storage of item[0]
size
- number of elements in the viewstride
- byte-index distance from one element to the nextprotected int getSize()
getSize
in class BaseBuffer
public int getLen()
PyBUF
shape
array, and the item size in bytes.getLen
in interface PyBUF
getLen
in class BaseBuffer
protected int calcGreatestIndex()
BaseBuffer.byteIndex(int...)
. The first byte not used will be one itemsize
more
than the returned value.
Specialised to one-dimensional, possibly strided buffer.
calcGreatestIndex
in class BaseBuffer
protected int calcLeastIndex()
BaseBuffer.byteIndex(int...)
.
Specialised to one-dimensional, possibly strided buffer.
calcLeastIndex
in class BaseBuffer
public boolean isContiguous(char order)
Specialised in BaseArrayBuffer
to one dimension.
isContiguous
in interface PyBUF
isContiguous
in class BaseBuffer
order
- 'C', 'F' or 'A', as the storage order is C, Fortran or either.