Package org.robovm.rt.bro.ptr
Class MachineSizedSIntPtr
- All Implemented Interfaces:
Iterable<MachineSizedSIntPtr>
public final class MachineSizedSIntPtr extends Struct<MachineSizedSIntPtr>
Points to a 32-bit or 64-bit signed value depending on the machine word
size (
long * in C).-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMachineSizedSIntPtr.MachineSizedSIntPtrPtrPointer toMachineSizedSIntPtr(long **in C)Nested classes/interfaces inherited from class org.robovm.rt.bro.Struct
Struct.Marshaler -
Constructor Summary
Constructors Constructor Description MachineSizedSIntPtr()Creates a newMachineSizedSIntPtrwith a value of 0. -
Method Summary
Modifier and Type Method Description IntBufferasIntBuffer(int n)Returns aIntBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedSIntPtr.LongBufferasLongBuffer(int n)Returns aLongBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedSIntPtr.longget()Returns the current value.voidget(int[] dst)voidget(int[] dst, int offset, int count)Copiescountints from the memory pointed to by thisMachineSizedSIntPtrtodststarting at offsetoffset.voidget(long[] dst)voidget(long[] dst, int offset, int count)Copiescountlongs from the memory pointed to by thisMachineSizedSIntPtrtodststarting at offsetoffset.voidset(int[] src)voidset(int[] src, int offset, int count)Copiescountints fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedSIntPtr.voidset(long value)Sets the value.voidset(long[] src)voidset(long[] src, int offset, int count)Copiescountlongs fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedSIntPtr.int[]toIntArray(int n)long[]toLongArray(int n)Methods inherited from class org.robovm.rt.bro.Struct
_sizeOf, allocate, allocate, as, clear, clear, copy, copy, copyWithMalloc, copyWithMalloc, free, iterator, iterator, malloc, malloc, next, next, offsetOf, previous, previous, sizeOf, sizeOf, toArray, toList, toStruct, update, update, update, wrapMethods inherited from class org.robovm.rt.bro.NativeObject
equals, getHandle, hashCode, setHandle
-
Constructor Details
-
MachineSizedSIntPtr
public MachineSizedSIntPtr()Creates a newMachineSizedSIntPtrwith a value of 0.
-
-
Method Details
-
get
public long get()Returns the current value.- Returns:
- the value.
-
set
public void set(long value)Sets the value.- Parameters:
value- the new value.
-
asIntBuffer
Returns aIntBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedSIntPtr. Must only be called on 32-bit platforms.- Parameters:
n- the maximum number of ints theIntBuffercan read/write. This will be theIntBuffer'scapacity.- Returns:
- the
IntBuffer. - Throws:
IllegalStateException- if this isn't a 32-bit platform.
-
asLongBuffer
Returns aLongBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedSIntPtr. Must only be called on 64-bit platforms.- Parameters:
n- the maximum number of longs theLongBuffercan read/write. This will be theLongBuffer'scapacity.- Returns:
- the
LongBuffer. - Throws:
IllegalStateException- if this isn't a 64-bit platform.
-
toIntArray
public int[] toIntArray(int n)Copiesnints from the memory pointed to by thisMachineSizedSIntPtrto a newint[]instance. Does the proper narrowinglongtointconversion if running on a 64-bit platform.- Parameters:
n- the number of ints to copy.- Returns:
- the
int[].
-
get
public void get(int[] dst)Copiesdst.lengthints from the memory pointed to by thisMachineSizedSIntPtrtodst. Does the proper narrowinglongtointconversion if running on a 64-bit platform.- Parameters:
dst- the destination.
-
get
public void get(int[] dst, int offset, int count)Copiescountints from the memory pointed to by thisMachineSizedSIntPtrtodststarting at offsetoffset. Does the proper narrowinglongtointconversion if running on a 64-bit platform.- Parameters:
dst- the destination.offset- the offset within the destination array to start copying to.count- the number of elements to copy.
-
set
public void set(int[] src)Copiessrc.lengthints fromsrcto the memory pointed to by thisMachineSizedSIntPtr. Does signedinttolongconversion if running on a 64-bit platform.- Parameters:
src- the source.
-
set
public void set(int[] src, int offset, int count)Copiescountints fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedSIntPtr. Does signedinttolongconversion if running on a 64-bit platform.- Parameters:
src- the source.offset- the offset within the source array to start copying from.count- the number of elements to copy.
-
toLongArray
public long[] toLongArray(int n)Copiesnlongs from the memory pointed to by thisMachineSizedSIntPtrto a newlong[]instance. Does signedinttolongconversion if running on a 32-bit platform.- Parameters:
n- the number of longs to copy.- Returns:
- the
long[].
-
get
public void get(long[] dst)Copiesdst.lengthlongs from the memory pointed to by thisMachineSizedSIntPtrtodst. Does signedinttolongconversion if running on a 32-bit platform.- Parameters:
dst- the destination.
-
get
public void get(long[] dst, int offset, int count)Copiescountlongs from the memory pointed to by thisMachineSizedSIntPtrtodststarting at offsetoffset. Does signedinttolongconversion if running on a 32-bit platform.- Parameters:
dst- the destination.offset- the offset within the destination array to start copying to.count- the number of elements to copy.
-
set
public void set(long[] src)Copiessrc.lengthlongs fromsrcto the memory pointed to by thisMachineSizedSIntPtr. Does the proper narrowinglongtointconversion if running on a 32-bit platform.- Parameters:
src- the source.
-
set
public void set(long[] src, int offset, int count)Copiescountlongs fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedSIntPtr. Does the proper narrowinglongtointconversion if running on a 32-bit platform.- Parameters:
src- the source.offset- the offset within the source array to start copying from.count- the number of elements to copy.
-