Logo Search packages:      
Sourcecode: libjna-java version File versions  Download package

com::sun::jna::Union Class Reference

Inheritance diagram for com::sun::jna::Union:


List of all members.

Detailed Description

Represents a native union. When writing to native memory, the field corresponding to the type passed to setType will be written to native memory. Upon reading from native memory, Structure, String, or WString fields will not be initialized unless they are the current field as identified by a call to setType. The current field is always unset by default to avoid accidentally attempting to read a field that is not valid. In the case of a String, for instance, an invalid pointer may result in a memory fault when attempting to initialize the String.

Definition at line 27 of file Union.java.

Public Member Functions

void clear ()
boolean equals (Object o)
Pointer getPointer ()
int hashCode ()
void read ()
Object readField (String name)
void setType (Class type)
int size ()
Structure[] toArray (int size)
Structure[] toArray (Structure[] array)
String toString ()
void write ()
void writeField (String name)

Static Public Member Functions

static Structure newInstance (Class type) throws IllegalArgumentException

Static Public Attributes

static final int ALIGN_DEFAULT = 0
static final int ALIGN_GNUC = 2
static final int ALIGN_MSVC = 3
static final int ALIGN_NONE = 1

Protected Member Functions

void allocateMemory (int size)
void allocateMemory ()
void ensureAllocated ()
int getNativeAlignment (Class type, Object value, boolean isFirstElement)
int getStructAlignment ()
void setAlignType (int alignType)
void setTypeMapper (TypeMapper mapper)
 Union (int size, int alignType)
 Union (int size)
 Union ()
void useMemory (Pointer m, int offset)
void useMemory (Pointer m)

Static Protected Attributes

static final int CALCULATE_SIZE = -1

Package Functions

int calculateAlignedSize (int calculatedSize)
int calculateSize (boolean force)
Map fields ()
Object getField (StructField structField)
Pointer getTypeInfo ()
Object readField (StructField field)
void writeField (StructField field)

Static Package Functions

 [static initializer]
static Pointer getTypeInfo (Object obj)
static Structure updateStructureByReference (Class type, Structure s, Pointer address)

Static Package Attributes

static final boolean isPPC
static final boolean isSPARC

Private Attributes

StructField activeField
StructField biggestField

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index