Class BoolPointer
java.lang.Object
org.bytedeco.javacpp.Pointer
org.bytedeco.javacpp.BoolPointer
- All Implemented Interfaces:
AutoCloseable
The peer class to native pointers and arrays of
bool.
All operations take into account the position and limit, when appropriate.
We need this class because C++ does not define the size of the bool type.
-
Nested Class Summary
Nested classes/interfaces inherited from class Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator, Pointer.ProxyDeallocator, Pointer.ReferenceCounter -
Field Summary
FieldsFields inherited from class Pointer
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidallocateArray(long size) capacity(long capacity) Sets the capacity and returns this.booleanget()booleanget(long i) getPointer(long i) ReturnsgetPointer(getClass(), i).limit(long limit) Sets the limit and returns this.position(long position) Sets the position and returns this.put(boolean b) put(long i, boolean b) Copies theboolvalue to the i-th element of a native array.Methods inherited from class Pointer
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, init, interruptDeallocatorThread, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
-
Field Details
-
logger
-
-
Constructor Details
-
BoolPointer
public BoolPointer(long size) Allocates a nativeboolarray of the given size.- Parameters:
size- the number ofboolelements to allocate
-
BoolPointer
public BoolPointer()- See Also:
-
BoolPointer
- See Also:
-
-
Method Details
-
allocateArray
private void allocateArray(long size) -
position
Description copied from class:PointerSets the position and returns this. That makes thearray.position(i)statement sort of equivalent to thearray[i]statement in C++. -
limit
Description copied from class:PointerSets the limit and returns this. Used to limit the size of an operation on this object. -
capacity
Description copied from class:PointerSets the capacity and returns this. Should not be called more than once after allocation. -
getPointer
Description copied from class:PointerReturnsgetPointer(getClass(), i).- Overrides:
getPointerin classPointer
-
get
public boolean get()- Returns:
get(0)
-
get
- Parameters:
i-- Returns:
- the i-th
boolvalue of a native array
-
put
- Returns:
put(0, b)
-
put
Copies theboolvalue to the i-th element of a native array.- Parameters:
i- the index into the arrayb- theboolvalue to copy- Returns:
- this
-