jnr.ffi
Class Runtime

java.lang.Object
  extended by jnr.ffi.Runtime
Direct Known Subclasses:
AbstractRuntime

public abstract class Runtime
extends java.lang.Object

Accessor for various runtime specific parameters


Constructor Summary
Runtime()
           
 
Method Summary
abstract  long addressMask()
          Gets the address mask for this runtime
abstract  int addressSize()
          Gets the size of an address (e.g.
abstract  java.nio.ByteOrder byteOrder()
          Retrieves this runtime's native byte order.
abstract  Type findType(NativeType type)
          Looks up the runtime-specific that corresponds to the pseudo-type
abstract  Type findType(TypeAlias type)
          Looks up the runtime-specific that corresponds to the pseudo-type
abstract  int getLastError()
          Gets the last native error code.
abstract  MemoryManager getMemoryManager()
          Gets the native memory manager instance for this runtime
static Runtime getSystemRuntime()
          Gets the global Runtime for the current FFI provider
abstract  int longSize()
          Gets the size of a C long integer for this runtime
abstract  ObjectReferenceManager newObjectReferenceManager()
           
abstract  void setLastError(int error)
          Sets the native error code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Runtime

public Runtime()
Method Detail

getSystemRuntime

public static final Runtime getSystemRuntime()
Gets the global Runtime for the current FFI provider


findType

public abstract Type findType(NativeType type)
Looks up the runtime-specific that corresponds to the pseudo-type


findType

public abstract Type findType(TypeAlias type)
Looks up the runtime-specific that corresponds to the pseudo-type


getMemoryManager

public abstract MemoryManager getMemoryManager()
Gets the native memory manager instance for this runtime

Returns:
a MemoryManager

newObjectReferenceManager

public abstract ObjectReferenceManager newObjectReferenceManager()

getLastError

public abstract int getLastError()
Gets the last native error code.

This returns the errno value that was set at the time of the last native function call.

Returns:
The errno value.

setLastError

public abstract void setLastError(int error)
Sets the native error code.

Parameters:
error - The value to set errno to.

addressMask

public abstract long addressMask()
Gets the address mask for this runtime


addressSize

public abstract int addressSize()
Gets the size of an address (e.g. a pointer) for this runtime

Returns:
The size of an address in bytes.

longSize

public abstract int longSize()
Gets the size of a C long integer for this runtime

Returns:
The size of a C long integer in bytes.

byteOrder

public abstract java.nio.ByteOrder byteOrder()
Retrieves this runtime's native byte order.

Returns:
this runtime's byte order


Copyright © 2012. All Rights Reserved.