@Name(value="size_t") @Properties(inherit=javacpp.class) public class SizeTPointer extends Pointer
size_t
.
All operations take into account the position and limit, when appropriate.
We need this class because the size differs between 32-bit and 64-bit platforms.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator, Pointer.ProxyDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger |
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position
Constructor and Description |
---|
SizeTPointer() |
SizeTPointer(long... array)
Allocates enough memory for the array and copies it.
|
SizeTPointer(long size)
Allocates a native
size_t array of the given size. |
SizeTPointer(Pointer p) |
Modifier and Type | Method and Description |
---|---|
private void |
allocateArray(long size) |
SizeTPointer |
capacity(long capacity)
Sets the capacity and returns this.
|
long |
get() |
long |
get(long i) |
SizeTPointer |
get(long[] array) |
SizeTPointer |
get(long[] array,
int offset,
int length)
Reads a portion of the native array into a Java array.
|
SizeTPointer |
limit(long limit)
Sets the limit and returns this.
|
SizeTPointer |
position(long position)
Sets the position and returns this.
|
SizeTPointer |
put(long... array) |
SizeTPointer |
put(long s) |
SizeTPointer |
put(long[] array,
int offset,
int length)
Writes a portion of a Java array into the native array.
|
SizeTPointer |
put(long i,
long s)
Copies the
size_t value to the i-th element of a native array. |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, init, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
private static final Logger logger
public SizeTPointer(long... array)
array
- the array to copyput(long[])
public SizeTPointer(long size)
size_t
array of the given size.size
- the number of size_t
elements to allocatepublic SizeTPointer()
Pointer.Pointer()
public SizeTPointer(Pointer p)
Pointer.Pointer(Pointer)
private void allocateArray(long size)
public SizeTPointer position(long position)
Pointer
array.position(i)
statement sort of equivalent to the array[i]
statement in C++.position
in class Pointer
position
- the new positionPointer.position(long)
public SizeTPointer limit(long limit)
Pointer
limit
in class Pointer
limit
- the new limitPointer.limit(long)
public SizeTPointer capacity(long capacity)
Pointer
capacity
in class Pointer
capacity
- the new capacityPointer.capacity(long)
public long get()
get(0)
public SizeTPointer put(long s)
put(0, s)
public SizeTPointer put(long i, long s)
size_t
value to the i-th element of a native array.i
- the index into the arrays
- the size_t
value to copypublic SizeTPointer get(long[] array)
get(array, 0, array.length)
public SizeTPointer put(long... array)
put(array, 0, array.length)
public SizeTPointer get(long[] array, int offset, int length)
array
- the array to write tooffset
- the offset into the array where to start writinglength
- the length of data to read and writepublic SizeTPointer put(long[] array, int offset, int length)
array
- the array to read fromoffset
- the offset into the array where to start readinglength
- the length of data to read and writeCopyright © 2020. All rights reserved.