Package org.robovm.rt.bro.ptr
Class MachineSizedFloatPtr
- All Implemented Interfaces:
Iterable<MachineSizedFloatPtr>
public final class MachineSizedFloatPtr extends Struct<MachineSizedFloatPtr>
Points to either a
float or double value depending on the
machine word.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMachineSizedFloatPtr.MachineSizedFloatPtrPtrPointer toMachineSizedFloatPtr.Nested classes/interfaces inherited from class org.robovm.rt.bro.Struct
Struct.Marshaler -
Constructor Summary
Constructors Constructor Description MachineSizedFloatPtr()Creates a newMachineSizedFloatPtrwith a value of 0.0. -
Method Summary
Modifier and Type Method Description DoubleBufferasDoubleBuffer(int n)Returns aDoubleBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedFloatPtr.FloatBufferasFloatBuffer(int n)Returns aFloatBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedFloatPtr.doubleget()Returns the current value.voidget(double[] dst)voidget(double[] dst, int offset, int count)Copiescountdoubles from the memory pointed to by thisMachineSizedFloatPtrtodststarting at offsetoffset.voidget(float[] dst)voidget(float[] dst, int offset, int count)Copiescountfloats from the memory pointed to by thisMachineSizedFloatPtrtodststarting at offsetoffset.voidset(double value)Sets the value.voidset(double[] src)voidset(double[] src, int offset, int count)Copiescountdoubles fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedFloatPtr.voidset(float[] src)voidset(float[] src, int offset, int count)Copiescountfloats fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedFloatPtr.double[]toDoubleArray(int n)Copiesndoubles from the memory pointed to by thisMachineSizedFloatPtrto a newdouble[]instance.float[]toFloatArray(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
-
MachineSizedFloatPtr
public MachineSizedFloatPtr()Creates a newMachineSizedFloatPtrwith a value of 0.0.
-
-
Method Details
-
get
public double get()Returns the current value.- Returns:
- the value.
-
set
public void set(double value)Sets the value.- Parameters:
value- the new value.
-
asFloatBuffer
Returns aFloatBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedFloatPtr. Must only be called on 32-bit platforms.- Parameters:
n- the maximum number of floats theFloatBuffercan read/write. This will be theFloatBuffer'scapacity.- Returns:
- the
FloatBuffer. - Throws:
IllegalStateException- if this isn't a 32-bit platform.
-
asDoubleBuffer
Returns aDoubleBufferwhich reads and writes to the same memory location pointed to by thisMachineSizedFloatPtr. Must only be called on 64-bit platforms.- Parameters:
n- the maximum number of doubles theDoubleBuffercan read/write. This will be theDoubleBuffer'scapacity.- Returns:
- the
DoubleBuffer. - Throws:
IllegalStateException- if this isn't a 64-bit platform.
-
toFloatArray
public float[] toFloatArray(int n)Copiesnfloats from the memory pointed to by thisMachineSizedFloatPtrto a newfloat[]instance. Doesdoubletofloatconversion if running on a 64-bit platform.- Parameters:
n- the number of floats to copy.- Returns:
- the
float[].
-
get
public void get(float[] dst)Copiesdst.lengthfloats from the memory pointed to by thisMachineSizedFloatPtrtodst. Doesdoubletofloatconversion if running on a 64-bit platform.- Parameters:
dst- the destination.
-
get
public void get(float[] dst, int offset, int count)Copiescountfloats from the memory pointed to by thisMachineSizedFloatPtrtodststarting at offsetoffset. Doesdoubletofloatconversion 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(float[] src)Copiessrc.lengthfloats fromsrcto the memory pointed to by thisMachineSizedFloatPtr. Doesfloattodoubleconversion if running on a 64-bit platform.- Parameters:
src- the source.
-
set
public void set(float[] src, int offset, int count)Copiescountfloats fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedFloatPtr. Doesfloattodoubleconversion 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.
-
toDoubleArray
public double[] toDoubleArray(int n)Copiesndoubles from the memory pointed to by thisMachineSizedFloatPtrto a newdouble[]instance. Doesfloattodoubleconversion if running on a 32-bit platform.- Parameters:
n- the number of doubles to copy.- Returns:
- the
float[].
-
get
public void get(double[] dst)Copiesdst.lengthdoubles from the memory pointed to by thisMachineSizedFloatPtrtodst. Doesfloattodoubleconversion if running on a 32-bit platform.- Parameters:
dst- the destination.
-
get
public void get(double[] dst, int offset, int count)Copiescountdoubles from the memory pointed to by thisMachineSizedFloatPtrtodststarting at offsetoffset. Doesfloattodoubleconversion 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(double[] src)Copiessrc.lengthdoubles fromsrcto the memory pointed to by thisMachineSizedFloatPtr. Doesdoubletofloatconversion if running on a 32-bit platform.- Parameters:
src- the source.
-
set
public void set(double[] src, int offset, int count)Copiescountdoubles fromsrcstarting at offsetoffsetto the memory pointed to by thisMachineSizedFloatPtr. Doesdoubletofloatconversion 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.
-