@Retention(value=RUNTIME) @Target(value=TYPE) public @interface CPointerTo
PointerBase
, i.e., it is a word type. There is never a Java class that implements the
interface.
If the method has a non-void return type that is not the annotated interface, it is a read-method
of the pointer. Calls of the method are replaced with a memory read. The possible signatures are
ValueType read([IntType index], [LocationIdentity locationIdentity]);
If the method has the return type void, it is a write-method of the pointer. Calls of the method
are replaced with a memory write. The possible signatures are
void write([IntType index], ValueType value, [LocationIdentity locationIdentity]);
If the return type of the method is the annotated interface, it is an address computation for an
array access. Calls of the method are replaced with address arithmetic. The possible signatures
are PointerType addressOf(IntType index);
The receiver is the pointer that is accessed, i.e., the base address of the memory access.
The ValueType
must be the Java-equivalent of the C type used in the pointer definition.
The optional parameter index
(always the first parameter when it is present) denotes an
index, i.e., the receiver is treated as an array of the pointers. The type must be a primitive
integer type or a word type
. Address arithmetic is used to scale the index with
the size of the value type.
The optional parameter locationIdentity
specifies the LocationIdentity
to be used
for the memory access. Two memory accesses with two different location identities are guaranteed
to not alias. The parameter cannot be used together with the UniqueLocationIdentity
annotation, which is another way of providing a location identity for the memory access.
Modifier and Type | Optional Element and Description |
---|---|
String |
nameOfCType
The value type, as C type name.
|
Class<? extends WordBase> |
value
The value type, as a reference to a Java interface that is either annotated with
CStruct or CPointerTo . |
public abstract Class<? extends WordBase> value
CStruct
or CPointerTo
.
Exactly one of the properties CPointerTo.value()
and CPointerTo.nameOfCType()
must be
specified.
public abstract String nameOfCType
Exactly one of the properties CPointerTo.value()
and CPointerTo.nameOfCType()
must be
specified.