Class BoolPointer

java.lang.Object
org.bytedeco.javacpp.Pointer
org.bytedeco.javacpp.BoolPointer
All Implemented Interfaces:
AutoCloseable

@Name("bool") @Properties(inherit=javacpp.class) public class BoolPointer extends Pointer
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.

  • Field Details

    • logger

      private static final Logger logger
  • Constructor Details

    • BoolPointer

      public BoolPointer(long size)
      Allocates a native bool array of the given size.
      Parameters:
      size - the number of bool elements to allocate
    • BoolPointer

      public BoolPointer()
      See Also:
    • BoolPointer

      public BoolPointer(Pointer p)
      See Also:
  • Method Details

    • allocateArray

      private void allocateArray(long size)
    • position

      public BoolPointer position(long position)
      Description copied from class: Pointer
      Sets the position and returns this. That makes the array.position(i) statement sort of equivalent to the array[i] statement in C++.
      Overrides:
      position in class Pointer
      Parameters:
      position - the new position
      Returns:
      this
      See Also:
    • limit

      public BoolPointer limit(long limit)
      Description copied from class: Pointer
      Sets the limit and returns this. Used to limit the size of an operation on this object.
      Overrides:
      limit in class Pointer
      Parameters:
      limit - the new limit
      Returns:
      this
      See Also:
    • capacity

      public BoolPointer capacity(long capacity)
      Description copied from class: Pointer
      Sets the capacity and returns this. Should not be called more than once after allocation.
      Overrides:
      capacity in class Pointer
      Parameters:
      capacity - the new capacity
      Returns:
      this
      See Also:
    • getPointer

      public BoolPointer getPointer(long i)
      Description copied from class: Pointer
      Returns getPointer(getClass(), i).
      Overrides:
      getPointer in class Pointer
    • get

      public boolean get()
      Returns:
      get(0)
    • get

      @Cast("bool") public boolean get(long i)
      Parameters:
      i -
      Returns:
      the i-th bool value of a native array
    • put

      public BoolPointer put(boolean b)
      Returns:
      put(0, b)
    • put

      public BoolPointer put(long i, boolean b)
      Copies the bool value to the i-th element of a native array.
      Parameters:
      i - the index into the array
      b - the bool value to copy
      Returns:
      this