This is the basic interface which describes a field in a C/C++ data structure or a Java object.
The accessors in this class are designed to allow manual coercion of the data within the field, which is often necessary when interfacing with C programs. Therefore, the accessors here do not perform any type checking. Specializations of the Field interface, such as JByteField, provide getValue() methods which both perform type checking and return the appropriate specialized type.
See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType".
As an example, coercing a pointer field into an int can be done in the following fashion (assuming the application has registered an integer type in the type database called "intptr_t"):
{ ... Address myObject = ...; CIntegerType intptr_tType = (CIntegerType) db.lookupType("intptr_t"); long addrVal = field.getCInteger(myObject, intptr_tType); ... }FIXME: among other things, this interface is not sufficient to describe fields which are themselves arrays (like symbolOop's jbyte _body[1]).
|
|
|
|
|
|