Package org.robovm.rt.bro
Class Struct<T extends Struct<T>>
java.lang.Object
org.robovm.rt.bro.NativeObject
org.robovm.rt.bro.Struct<T>
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
BooleanPtr,BytePtr,CharPtr,DoublePtr,FloatPtr,FunctionPtr,IntPtr,LongPtr,MachineSizedFloatPtr,MachineSizedSIntPtr,MachineSizedUIntPtr,Ptr,ShortPtr,VoidPtr
public abstract class Struct<T extends Struct<T>> extends NativeObject implements Iterable<T>
- Version:
- $Id$
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStruct.Marshaler -
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected int_sizeOf()static <T extends Struct<T>>
Tallocate(Class<T> cls)static <T extends Struct<T>>
Tallocate(Class<T> cls, int n)<U extends NativeObject>
Uas(Class<U> type)Casts thisNativeObjectto anotherNativeObjecttype.voidclear()voidclear(int n)Tcopy()Tcopy(int n)TcopyWithMalloc()TcopyWithMalloc(int n)voidfree()Iterator<T>iterator()Returns anIteratorfor the elements in this object.Iterator<T>iterator(int n)static <T extends Struct<T>>
Tmalloc(Class<T> cls)static <T extends Struct<T>>
Tmalloc(Class<T> cls, int n)Tnext()Tnext(long delta)static intoffsetOf(int index)Tprevious()Tprevious(long delta)static intsizeOf()static intsizeOf(Struct<?> struct)T[]toArray(int n)List<T>toList(int n)static <T extends Struct<T>>
TtoStruct(Class<T> cls, long handle)voidupdate(T o)voidupdate(T[] array)voidupdate(T o, int n)protected Twrap(long address)Methods inherited from class org.robovm.rt.bro.NativeObject
equals, getHandle, hashCode, setHandle
-
Constructor Details
-
Struct
protected Struct() -
Struct
protected Struct(long handle)
-
-
Method Details
-
copy
-
copy
-
copyWithMalloc
-
copyWithMalloc
-
as
Description copied from class:NativeObjectCasts thisNativeObjectto anotherNativeObjecttype.- Overrides:
asin classNativeObject- Parameters:
type- the type to cast to.- Returns:
- a
NativeObjectthat points to the same memory location as thisNativeObject.
-
_sizeOf
protected int _sizeOf() -
clear
public void clear() -
clear
public void clear(int n) -
free
public void free() -
iterator
Description copied from interface:IterableReturns anIteratorfor the elements in this object. -
iterator
-
wrap
-
next
-
next
-
previous
-
previous
-
toArray
-
update
- Parameters:
o- theStructto write to the address of thisStruct.- Throws:
NullPointerException- ifoisnull.IllegalArgumentException- if the class ofois not the same as thisStruct's class.
-
update
- Parameters:
o- the firstStructto write to the address of thisStruct.n- the number ofStructs to write.- Throws:
NullPointerException- ifoisnull.IllegalArgumentException- if the class ofois not the same as thisStruct's class.
-
update
- Parameters:
array- the array ofStructs to write.- Throws:
NullPointerException- ifarrayor any of the objects inarrayarenull.IllegalArgumentException- if the class of any of the objects in the array is not the same as thisStruct's class.
-
toList
-
sizeOf
public static int sizeOf() -
sizeOf
-
offsetOf
public static int offsetOf(int index) -
allocate
-
allocate
-
malloc
-
malloc
-
toStruct
-