Package org.bytedeco.javacpp
Class BoolPointer
- java.lang.Object
-
- org.bytedeco.javacpp.Pointer
-
- org.bytedeco.javacpp.BoolPointer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
@Name("bool") @Properties(inherit=javacpp.class) public class BoolPointer extends Pointer
The peer class to native pointers and arrays ofbool. All operations take into account the position and limit, when appropriate.We need this class because C++ does not define the size of the
booltype.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bytedeco.javacpp.Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator, Pointer.ProxyDeallocator, Pointer.ReferenceCounter
-
-
Field Summary
Fields Modifier and Type Field Description private static Loggerlogger-
Fields inherited from class org.bytedeco.javacpp.Pointer
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position
-
-
Constructor Summary
Constructors Constructor Description BoolPointer()BoolPointer(long size)Allocates a nativeboolarray of the given size.BoolPointer(Pointer p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidallocateArray(long size)BoolPointercapacity(long capacity)Sets the capacity and returns this.booleanget()booleanget(long i)BoolPointergetPointer(long i)ReturnsgetPointer(getClass(), i).BoolPointerlimit(long limit)Sets the limit and returns this.BoolPointerposition(long position)Sets the position and returns this.BoolPointerput(boolean b)BoolPointerput(long i, boolean b)Copies theboolvalue to the i-th element of a native array.-
Methods inherited from class org.bytedeco.javacpp.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 Detail
-
logger
private static final Logger logger
-
-
Constructor Detail
-
BoolPointer
public BoolPointer(long size)
Allocates a nativeboolarray of the given size.- Parameters:
size- the number ofboolelements to allocate
-
BoolPointer
public BoolPointer()
- See Also:
Pointer()
-
BoolPointer
public BoolPointer(Pointer p)
- See Also:
Pointer(Pointer)
-
-
Method Detail
-
allocateArray
private void allocateArray(long size)
-
position
public BoolPointer position(long 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++.- Overrides:
positionin classPointer- Parameters:
position- the new position- Returns:
- this
- See Also:
Pointer.position(long)
-
limit
public BoolPointer limit(long limit)
Description copied from class:PointerSets the limit and returns this. Used to limit the size of an operation on this object.- Overrides:
limitin classPointer- Parameters:
limit- the new limit- Returns:
- this
- See Also:
Pointer.limit(long)
-
capacity
public BoolPointer capacity(long capacity)
Description copied from class:PointerSets the capacity and returns this. Should not be called more than once after allocation.- Overrides:
capacityin classPointer- Parameters:
capacity- the new capacity- Returns:
- this
- See Also:
Pointer.capacity(long)
-
getPointer
public BoolPointer getPointer(long i)
Description copied from class:PointerReturnsgetPointer(getClass(), i).- Overrides:
getPointerin classPointer
-
get
public boolean get()
- Returns:
get(0)
-
get
@Cast("bool") public boolean get(long i)
- Parameters:
i-- Returns:
- the i-th
boolvalue of a native array
-
put
public BoolPointer put(boolean b)
- Returns:
put(0, b)
-
put
public BoolPointer put(long i, boolean b)
Copies theboolvalue to the i-th element of a native array.- Parameters:
i- the index into the arrayb- theboolvalue to copy- Returns:
- this
-
-