org.bridj.ann
Annotation Type Field


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface Field

Indicate the index of a structure field (in Java, the order of methods and fields is unspecified so you need to order them explicitely).
For C++ structs, the index is absolute : it must take into account the fields in parent classes (unlike Virtual, which virtual table offset is relative to the declared class).

Author:
ochafik

Required Element Summary
 int value
          Index of the field in a struct (first field has index 0).
 
Optional Element Summary
 int unionWith
          Declare that this field shares its space with another (the two or more fields are in an union).
 

Element Detail

value

public abstract int value
Index of the field in a struct (first field has index 0).
Fields of parent structures must be taken into account (if parent struct has 2 fields, first field of sub-struct has index 2).
If more than one field are given the same index, this will produce an union at that index.

unionWith

public abstract int unionWith
Declare that this field shares its space with another (the two or more fields are in an union).
The unionWith index must be the index of the first field of the union.

Default:
-1


Copyright © 2009-2012. All Rights Reserved.