com.jniwrapper
Class OutOnly

java.lang.Object
  |
  +--com.jniwrapper.Parameter
        |
        +--com.jniwrapper.DelegatingParameter
              |
              +--com.jniwrapper.OutOnly

public class OutOnly
extends com.jniwrapper.DelegatingParameter

Represents parameter that is only written by a native function. Documentation usually specify such parameters as [out]. Initial contents of the corresponding memory area during function call are undefined.


Constructor Summary
OutOnly(OutOnly t)
           
OutOnly(Parameter param)
           
 
Method Summary
protected  void acceptIOPerformer(IOPerformer performer, DataBuffer source, int initialOffset)
          Realization of a Visitor pattern for parameter IO.
 java.lang.Object clone()
           
protected  DataBuffer getBuffer()
          Returns current data storage.
 int getLength()
          Returns a length of the parameter in memory.
protected  int getOffset()
          Returns current offset within data storage.
 void pop(DataBuffer stackBuffer, int offset)
          Default implementation, which does nothing as most primitive types do nothing on pop.
 void read(DataBuffer stackBuffer, int offset)
          Reads this parameter from a specified data source.
protected  void setBuffer(DataBuffer newSource, int newOffset)
          Sets the data buffer this parameter should use to store data and an offset in bytes within that buffer.
 java.lang.String toString()
           
 void write(DataBuffer stackBuffer, int offset)
          Writes this parameter to a specified data source.
 
Methods inherited from class com.jniwrapper.Parameter
asReturnValue, equals, getAlignedLength, indent, push, read, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutOnly

public OutOnly(Parameter param)

OutOnly

public OutOnly(OutOnly t)
Method Detail

write

public void write(DataBuffer stackBuffer,
                  int offset)
           throws MemoryAccessViolationException
Description copied from class: Parameter
Writes this parameter to a specified data source.

Overrides:
write in class com.jniwrapper.DelegatingParameter
MemoryAccessViolationException

pop

public void pop(DataBuffer stackBuffer,
                int offset)
         throws MemoryAccessViolationException
Description copied from class: Parameter
Default implementation, which does nothing as most primitive types do nothing on pop. Reads a parameter from a function stack.

Overrides:
pop in class Parameter
MemoryAccessViolationException

clone

public java.lang.Object clone()
Specified by:
clone in class Parameter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

acceptIOPerformer

protected void acceptIOPerformer(IOPerformer performer,
                                 DataBuffer source,
                                 int initialOffset)
Description copied from class: Parameter
Realization of a Visitor pattern for parameter IO. A performer is responsible for I/Oing 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.

Overrides:
acceptIOPerformer in class Parameter
Parameters:
performer - visitor responsible for I/Oing the parameter
source - data buffer for I/O operation
initialOffset - I/O operation offset of this parameter in the buffer

setBuffer

protected void setBuffer(DataBuffer newSource,
                         int newOffset)
Description copied from class: Parameter
Sets the data buffer this parameter should use to store data and an offset in bytes within that buffer.

Overrides:
setBuffer in class Parameter

getBuffer

protected DataBuffer getBuffer()
Description copied from class: Parameter
Returns current data storage.

Overrides:
getBuffer in class Parameter

getOffset

protected int getOffset()
Description copied from class: Parameter
Returns current offset within data storage.

Overrides:
getOffset in class Parameter

getLength

public int getLength()
Description copied from class: Parameter
Returns a length of the parameter in memory. This method is analogous to C sizeof() operator.

Specified by:
getLength in class Parameter

read

public void read(DataBuffer stackBuffer,
                 int offset)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Reads this parameter from a specified data source.

Specified by:
read in class Parameter
MemoryAccessViolationException