Package org.jocl
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 Buffer
The buffer the pointer points toprivate long
The offset from the nativePointer, in bytesprivate long
The native pointer, written by native methodsprivate NativePointerObject[]
The array of pointers this pointer points to -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates 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) Buffer
Returns the Buffer of this Pointer(package private) long
Returns the byte offsetlong
Method to obtain the native pointer value.int
hashCode()
(package private) void
Set the given buffer as the contents of this PointertoString()
Returns a String representation of this object.(package private) NativePointerObject
withByteOffset
(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
Buffer getBuffer()Returns the Buffer of this Pointer- Returns:
- The Buffer of this Pointer
-
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
Returns a String representation of this object. -
hashCode
public int hashCode() -
equals
-