|
|||||||
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 |
java.lang.String |
toString()
|
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 |
equals, fromBytesValue, getLength, hashCode, isFixedLength, toBytesValue, toBytesValue |
Methods inherited from class com.smardec.j2native.Argument |
clone, finalize, free, getAlignedLength, readFromRAM, restoreFromRAM, storeToRAM, writeToRAM |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected TypedPointer(Argument refArgument)
refArgument
- referenced objectMethod Detail |
public Argument getReferencedArgument()
Argument
this pointer is referenced to.
Argument
public void setReferencedArgument(Argument refArgument)
Argument
.
refArgument
- Argument
to setpublic long getValue()
PointerType
public void setValue(long handle)
PointerType
handle
- memory handlepublic boolean isNull()
PointerType
public java.lang.String toString()
toString
in class java.lang.Object
protected void writeToStack(byte[] stack, int offset)
Argument
writeToStack
in class PointerArgument
stack
- it's byte array, where Argument
will be writtenoffset
- offset in stackprotected void readFromStack(byte[] stack, int offset)
Argument
readFromStack
in class PointerArgument
stack
- it's byte array, from which Argument
will be restoredoffset
- offset in stackprotected void write(long handle, int offset)
Argument
write
in class PointerArgument
handle
- identifies location in memory where Argument
will be writtenoffset
- memory address offsetprotected void read(long handle, int offset)
Argument
read
in class PointerArgument
handle
- identifies location in memory from which Argument
will be readoffset
- memory address offsetpublic 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 lengthpublic 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 Argument
side
- identifies part that should be updated
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |