|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.smardec.j2native.Argument
|
+--com.smardec.j2native.PointerArgument
|
+--com.smardec.j2native.TypedPointer
Pointer class represents a pointer to object in
terms of C language. Pointer type is defined by its referenced object.
| Field Summary |
| Fields inherited from class com.smardec.j2native.Argument |
JAVA_SIDE, NATIVE_SIDE |
| Constructor Summary | |
protected |
TypedPointer(Argument refArgument)
Constructs a new pointer to a given object. |
| Method Summary | |
Argument |
getAt(int elementIndex)
If we know exactly lenght of the referenced Argument, we
can represent this pointer as array pointer and perform iteration through this
array. |
Argument |
getAt(int elementOffset,
int elementSize)
Returns new Argument object, constructed from referenced
Argument and filled with a value retrieved from native memory. |
Argument |
getReferencedArgument()
Return Argument this pointer is referenced to. |
long |
getValue()
Returns native memory handle |
boolean |
isNull()
Tests if this pointer is null. |
protected void |
read(long handle,
int offset)
Reads itself from the memory. |
protected void |
readFromStack(byte[] stack,
int offset)
Read itself from stack. |
void |
setReferencedArgument(Argument refArgument)
Sets referenced Argument. |
void |
setValue(long handle)
Sets memory handle |
protected void |
update(byte side)
This method is used to synchronize Java side and native part. |
protected void |
write(long handle,
int offset)
Writes itself to the memory. |
protected void |
writeToStack(byte[] stack,
int offset)
Writes itself to stack. |
| Methods inherited from class com.smardec.j2native.PointerArgument |
fromBytesValue, getLength, isFixedLength, toBytesValue, toBytesValue |
| Methods inherited from class com.smardec.j2native.Argument |
clone, finalize, free, getAlignedLength, getResultFlags, readFromRAM, restoreFromRAM, storeToRAM, writeToRAM |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected TypedPointer(Argument refArgument)
refArgument - referenced object| Method Detail |
public Argument getReferencedArgument()
Argument this pointer is referenced to.
Argumentpublic void setReferencedArgument(Argument refArgument)
Argument.
refArgument - Argument to setpublic long getValue()
PointerType
public void setValue(long handle)
PointerType
handle - memory handlepublic boolean isNull()
PointerType
protected void writeToStack(byte[] stack,
int offset)
Argument
writeToStack in class PointerArgumentstack - it's byte array, where Argument will be writtenoffset - offset in stack
protected void readFromStack(byte[] stack,
int offset)
Argument
readFromStack in class PointerArgumentstack - it's byte array, from which Argument will be restoredoffset - offset in stack
protected void write(long handle,
int offset)
Argument
write in class PointerArgumenthandle - identifies location in memory where Argument
will be writtenoffset - memory address offset
protected void read(long handle,
int offset)
Argument
read in class PointerArgumenthandle - identifies location in memory from which Argument
will be readoffset - memory address offset
public Argument getAt(int elementIndex)
throws java.lang.RuntimeException
Argument, we
can represent this pointer as array pointer and perform iteration through this
array.
elementIndex - index of this imaginary array
java.lang.RuntimeException - if referenced Argument is not fixed length
public Argument getAt(int elementOffset,
int elementSize)
Argument object, constructed from referenced
Argument and filled with a value retrieved from native memory.
elementOffset - offset from the referenced Argument's
memory handle valueelementSize - size of the retrieved data in bytesprotected void update(byte side)
Argument
update in class Argumentside - identifies part that should be updated
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||