com.ochafik.lang.jnaerator.runtime
Class Union<S extends Union<S,V,R>,V extends S,R extends S>

java.lang.Object
  extended by com.sun.jna.Structure
      extended by com.sun.jna.Union
          extended by com.ochafik.lang.jnaerator.runtime.Union<S,V,R>
All Implemented Interfaces:
StructureType, StructureTypeDependent

public abstract class Union<S extends Union<S,V,R>,V extends S,R extends S>
extends Union
implements StructureType, StructureTypeDependent


Nested Class Summary
static interface Union.ByReference
           
static interface Union.ByValue
           
 
Field Summary
 
Fields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
 
Constructor Summary
Union()
           
 
Method Summary
 R byReference()
           
 V byValue()
           
 S[] castToArray()
           
 S[] castToArray(int size)
           
 S[] castToArray(Structure[] array)
           
 S clone()
           
static
<S extends Union>
S[]
newArray(Class<S> structClass, int arrayLength)
           
protected abstract  R newByReference()
           
protected abstract  V newByValue()
           
protected abstract  S newInstance()
           
 void read()
          Reads the fields of the struct from native memory
protected  void readDependency()
           
 void setDependency(StructureType type)
           
protected
<T extends Union<?,?,?>>
T
setupClone(T clone)
           
 S[] toArray()
          Deprecated. use castToArray instead
 S[] toArray(int size)
          Deprecated. use castToArray instead
 S[] toArray(Structure[] array)
          Deprecated. use castToArray instead
 S use(Buffer m)
           
 S use(Buffer b, long byteOffset)
           
 S use(Pointer m)
           
 S use(Pointer m, long byteOffset)
           
 void write()
          Writes the fields of the struct to native memory
 
Methods inherited from class com.sun.jna.Union
getNativeAlignment, getTypedValue, readField, setType, setTypedValue, writeField, writeField
 
Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, clear, ensureAllocated, equals, getAutoRead, getAutoWrite, getBitsAnnotation, getFieldOrder, getPointer, getStructAlignment, hashCode, newInstance, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setFieldOrder, setTypeMapper, size, sortFields, toString, useMemory, useMemory
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ochafik.lang.jnaerator.runtime.StructureType
getPointer, size
 

Constructor Detail

Union

public Union()
Method Detail

setDependency

public void setDependency(StructureType type)
Specified by:
setDependency in interface StructureTypeDependent

readDependency

protected void readDependency()

read

public void read()
Description copied from class: Structure
Reads the fields of the struct from native memory

Specified by:
read in interface StructureType
Overrides:
read in class Structure

write

public void write()
Description copied from class: Structure
Writes the fields of the struct to native memory

Specified by:
write in interface StructureType
Overrides:
write in class Structure

toArray

@Deprecated
public S[] toArray(int size)
Deprecated. use castToArray instead

Description copied from class: Structure
Returns a view of this structure's memory as an array of structures. Note that this Structure must have a public, no-arg constructor. If the structure is currently using auto-allocated Memory backing, the memory will be resized to fit the entire array.

Overrides:
toArray in class Structure

toArray

@Deprecated
public S[] toArray()
Deprecated. use castToArray instead


toArray

@Deprecated
public S[] toArray(Structure[] array)
Deprecated. use castToArray instead

Description copied from class: Structure
Returns a view of this structure's memory as an array of structures. Note that this Structure must have a public, no-arg constructor. If the structure is currently using auto-allocated Memory backing, the memory will be resized to fit the entire array.

Overrides:
toArray in class Structure

castToArray

public S[] castToArray(int size)

castToArray

public S[] castToArray()

castToArray

public S[] castToArray(Structure[] array)

newArray

public static <S extends Union> S[] newArray(Class<S> structClass,
                                             int arrayLength)

newInstance

protected abstract S newInstance()

newByValue

protected abstract V newByValue()

newByReference

protected abstract R newByReference()

byReference

public R byReference()

byValue

public V byValue()

clone

public S clone()
Overrides:
clone in class Object

setupClone

protected <T extends Union<?,?,?>> T setupClone(T clone)

use

public S use(Pointer m)
Specified by:
use in interface StructureType

use

public S use(Pointer m,
             long byteOffset)

use

public S use(Buffer m)

use

public S use(Buffer b,
             long byteOffset)


Copyright © 2009. All Rights Reserved.