|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jna.Structure
com.ochafik.lang.jnaerator.runtime.Structure<S,V,R>
public abstract class Structure<S extends Structure<S,V,R>,V extends S,R extends S>
Nested Class Summary | |
---|---|
static interface |
Structure.ByReference
|
static interface |
Structure.ByValue
|
Field Summary |
---|
Fields inherited from class com.sun.jna.Structure |
---|
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE |
Constructor Summary | |
---|---|
Structure()
|
Method Summary | ||
---|---|---|
R |
byReference()
|
|
V |
byValue()
|
|
S[] |
castToArray()
|
|
S[] |
castToArray(int size)
|
|
S[] |
castToArray(Structure[] array)
|
|
R[] |
castToReferenceArray()
|
|
R[] |
castToReferenceArray(int size)
|
|
V[] |
castToValueArray()
|
|
V[] |
castToValueArray(int size)
|
|
S |
clone()
|
|
int |
compareTo(Structure<S,V,R> o)
Simply does a memcmp between the two memory blocks of the two structures |
|
protected Integer |
getBitsAnnotation(Field field)
Override this in a subclass to support bit fields (@link http://en.wikipedia.org/wiki/C_syntax#Bit_fields) :
package com.sun.jna;
import java.lang.annotation |
|
static
|
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
|
setupClone(T clone)
|
|
protected
|
setupClone(T clone,
StructureType dependency)
|
|
S[] |
toArray()
Deprecated. use castToArray instead |
|
S[] |
toArray(int size)
Deprecated. use castToArray instead |
|
S[] |
toArray(Structure[] array)
Deprecated. use castToArray instead |
|
R[] |
toReferenceArray()
Deprecated. use castToArray instead |
|
R[] |
toReferenceArray(int size)
Deprecated. use castToArray instead |
|
V[] |
toValueArray()
Deprecated. use castToArray instead |
|
V[] |
toValueArray(int size)
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.Structure |
---|
allocateMemory, allocateMemory, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, clear, ensureAllocated, equals, getAutoRead, getAutoWrite, getFieldOrder, getNativeAlignment, getPointer, getStructAlignment, hashCode, newInstance, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setFieldOrder, setTypeMapper, size, sortFields, toString, useMemory, useMemory, writeField, writeField |
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 |
---|
public Structure()
Method Detail |
---|
public void setDependency(StructureType type)
setDependency
in interface StructureTypeDependent
protected void readDependency()
public void read()
Structure
read
in interface StructureType
read
in class Structure
public void write()
Structure
write
in interface StructureType
write
in class Structure
protected <T extends Structure<S,V,R>> T setupClone(T clone, StructureType dependency)
protected abstract S newInstance()
protected abstract V newByValue()
protected abstract R newByReference()
public R byReference()
public V byValue()
public S clone()
clone
in class Object
public static <S extends Structure> S[] newArray(Class<S> structClass, int arrayLength)
@Deprecated public S[] toArray(int size)
Structure
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.
toArray
in class Structure
@Deprecated public S[] toArray()
@Deprecated public R[] toReferenceArray(int size)
@Deprecated public V[] toValueArray(int size)
@Deprecated public R[] toReferenceArray()
@Deprecated public V[] toValueArray()
@Deprecated public S[] toArray(Structure[] array)
Structure
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.
toArray
in class Structure
public S[] castToArray(int size)
public S[] castToArray()
public R[] castToReferenceArray(int size)
public V[] castToValueArray(int size)
public R[] castToReferenceArray()
public V[] castToValueArray()
public S[] castToArray(Structure[] array)
protected Integer getBitsAnnotation(Field field)
Structure
package com.sun.jna;
import java.lang.annotation.*;
- Overrides:
getBitsAnnotation
in class Structure
public int compareTo(Structure<S,V,R> o)
compareTo
in interface Comparable<Structure<S extends Structure<S,V,R>,V extends S,R extends S>>
protected <T extends Union<?,?,?>> T setupClone(T clone)
public S use(Pointer m)
use
in interface StructureType
public S use(Pointer m, long byteOffset)
public S use(Buffer m)
public S use(Buffer b, long byteOffset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |