|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jocl.struct.Struct
public abstract class Struct
This class is the base class for all Java classes that should
represent a native 'struct'. A struct class may be created
by creating a public class that extends this Struct class,
and which contains public fields. All public non-volatile
fields will be considered as fields that correspond to the
element of native struct.
Example:
The class
Corresponds to a native struct like
public class Particle extends Struct
{
public float mass;
public cl_float4 position;
public cl_float4 velocity;
}
typedef struct Particle
{
float mass;
float4 position;
float4 velocity;
} Particle;
All fields of the derived class must either be primitive
fields, one of the OpenCL vector types defined in
CLTypes
, other Structs or arrays of these
types (except for boolean arrays). Structs containing
instances of themself are not supported and will cause
a CLException to be thrown during the initialization
of the Struct.
Constructor Summary | |
---|---|
protected |
Struct()
Creates a new instance of a struct. |
Method Summary | |
---|---|
static void |
showLayout(java.lang.Class<? extends Struct> structClass)
Debug function which prints the alignment layout of the given struct class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Struct()
Method Detail |
---|
public static void showLayout(java.lang.Class<? extends Struct> structClass)
structClass
- The class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |