Class NativePointerObject
java.lang.Object
org.jocl.NativePointerObject
- Direct Known Subclasses:
cl_abstract_properties, cl_command_queue, cl_context, cl_device_id, cl_event, cl_kernel, cl_mem, cl_platform_id, cl_program, cl_sampler, Pointer
Base class for all classes that store a native pointer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BufferThe buffer the pointer points toprivate longThe offset from the nativePointer, in bytesprivate longThe native pointer, written by native methodsprivate NativePointerObject[]The array of pointers this pointer points to -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new (null) Pointer(package private)NativePointerObject(Buffer buffer) Creates a Pointer to the given Buffer(package private)Copy constructor(package private)NativePointerObject(NativePointerObject[] pointers) Creates a Pointer to the given array of pointers(package private)NativePointerObject(NativePointerObject other, long byteOffset) Creates a copy of the given pointer, with an additional byte offset -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) BufferReturns the Buffer of this Pointer(package private) longReturns the byte offsetlongMethod to obtain the native pointer value.inthashCode()(package private) voidSet the given buffer as the contents of this PointertoString()Returns a String representation of this object.(package private) NativePointerObjectwithByteOffset(long byteOffset) Returns a new pointer with an offset of the given number of bytes
-
Field Details
-
nativePointer
private long nativePointerThe native pointer, written by native methods -
byteOffset
private long byteOffsetThe offset from the nativePointer, in bytes -
buffer
The buffer the pointer points to -
pointers
The array of pointers this pointer points to
-
-
Constructor Details
-
NativePointerObject
protected NativePointerObject()Creates a new (null) Pointer -
NativePointerObject
NativePointerObject(Buffer buffer) Creates a Pointer to the given Buffer- Parameters:
buffer- The buffer to point to
-
NativePointerObject
NativePointerObject(NativePointerObject[] pointers) Creates a Pointer to the given array of pointers- Parameters:
pointers- The array the pointer points to
-
NativePointerObject
NativePointerObject(NativePointerObject other) Copy constructor- Parameters:
other- The other Pointer
-
NativePointerObject
NativePointerObject(NativePointerObject other, long byteOffset) Creates a copy of the given pointer, with an additional byte offset- Parameters:
other- The other pointerbyteOffset- The additional byte offset
-
-
Method Details
-
getNativePointer
public long getNativePointer()Method to obtain the native pointer value. Clients should usually not use this pointer value directly. It is only intended for interoperability with other JNI based libraries.- Returns:
- The native pointer value
-
getByteOffset
long getByteOffset()Returns the byte offset- Returns:
- The byte offset
-
setBuffer
Set the given buffer as the contents of this Pointer- Parameters:
buffer- The buffer to set
-
getBuffer
-
withByteOffset
Returns a new pointer with an offset of the given number of bytes- Parameters:
byteOffset- The byte offset for the pointer- Returns:
- The new pointer with the given byte offset
-
toString
-
hashCode
-
equals
-