|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jniwrapper.Parameter
com.jniwrapper.Structure
com.jniwrapper.ComplexArray
Represents an array of objects.
All objects in the array must have the same type.
Note: If a function takes an array as its parameter, you should take Pointer referencing that ComplexArray object, instead of direct taking the ComplexArray instance.
| Field Summary |
| Fields inherited from class com.jniwrapper.Parameter |
LICENSE_TYPE, V |
| Constructor Summary | |
ComplexArray(Parameter[] arr)
Constructs an array object taking a specified Parameter
array. |
|
ComplexArray(Parameter sample,
int count)
Constructs an array object. |
|
| Method Summary | |
protected void |
acceptIOPerformer(IOPerformer performer,
DataBuffer source,
int initialOffset,
boolean isReadOperation,
boolean invokedByCallback)
Implementation of a Visitor pattern for parameter IO. |
static void |
arrayCopy(ComplexArray from,
ComplexArray to)
Copy ComplexArray content |
java.lang.Object |
clone()
|
void |
forceElementCount(int elementCount)
Sets a new array size without memory reallocation. |
void |
fromParameterArray(Parameter[] params)
Sets array contents to the given values. |
int |
getAlignmentRequirement()
|
Parameter |
getElement(int i)
Returns an array item specified by an index. |
int |
getElementCount()
Returns the number of elements in the array. |
void |
pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Default implementation that does nothing because most primitive types do nothing on pop. |
void |
push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes a parameter to a function stacks. |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source. |
protected void |
setDataBuffer(DataBuffer newSource,
int newOffset,
boolean shouldRead)
Sets the data buffer this parameter should use to store data and an offset in bytes within that buffer. |
void |
setElement(int i,
Parameter elem)
Replaces an array item with the specified object. |
void |
setElementCount(int elementCount)
Resizes this array to a given size. |
Parameter[] |
toParameterArray()
Returns items as Java array. |
java.lang.String |
toString()
|
void |
write(byte[] arr,
int offset)
Writes the parameter value to a byte array. |
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source. |
| Methods inherited from class com.jniwrapper.Structure |
addMembers, computeLength, equals, getDebugInfo, getFirstMemberSize, getLength, getMember, getMembers, getOffsets, init, init, initFrom |
| Methods inherited from class com.jniwrapper.Parameter |
asReturnValue, dataBufferAssigned, getAlignedLength, getDataBuffer, getDataBufferOffset, hashCode, indent, read, read, toByteArray |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ComplexArray(Parameter[] arr)
Parameter
array.
public ComplexArray(Parameter sample,
int count)
sample - a sample for items in the constructed arraycount - count of items in the constructed array| Method Detail |
public void write(byte[] arr,
int offset)
Parameter
write in class Parameterpublic java.lang.Object clone()
clone in class Structurepublic Parameter getElement(int i)
ArrayParameter
getElement in interface ArrayParameteri - index of a requested array item
public void setElement(int i,
Parameter elem)
ArrayParameter
setElement in interface ArrayParameteri - index of an item to be replacedelem - object to be set as array item
protected void setDataBuffer(DataBuffer newSource,
int newOffset,
boolean shouldRead)
Parameter
setDataBuffer in class Structure
protected void acceptIOPerformer(IOPerformer performer,
DataBuffer source,
int initialOffset,
boolean isReadOperation,
boolean invokedByCallback)
Parameterperformer is responsible for reading and writing the
parameter. Users implementing a complex parameter from scratch (i.e. not
by extending a pre-existing class such as Structure or
Pointer) may wish to override this method to make a
performer visit object internal parts.
acceptIOPerformer in class Structure
public void write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
write in class StructureMemoryAccessViolationException
public void read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
read in class StructureMemoryAccessViolationException
public void push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
push in class StructureMemoryAccessViolationException
public void pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
pop in class StructureMemoryAccessViolationExceptionpublic int getElementCount()
ArrayParameter
getElementCount in interface ArrayParameterpublic Parameter[] toParameterArray()
ArrayParameter
toParameterArray in interface ArrayParameterpublic void fromParameterArray(Parameter[] params)
ArrayParameter
fromParameterArray in interface ArrayParameterpublic java.lang.String toString()
public void forceElementCount(int elementCount)
ArrayParameter
forceElementCount in interface ArrayParameterpublic void setElementCount(int elementCount)
ArrayParameter
setElementCount in interface ArrayParameter
public static void arrayCopy(ComplexArray from,
ComplexArray to)
from - sourceto - destinationpublic int getAlignmentRequirement()
getAlignmentRequirement in class Structure
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||