jnr.ffi.provider
Class AbstractRuntime

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

public abstract class AbstractRuntime
extends Runtime


Constructor Summary
AbstractRuntime(ByteOrder byteOrder, EnumMap<NativeType,Type> typeMap)
           
 
Method Summary
 long addressMask()
          Gets the address mask for this runtime
 int addressSize()
          Gets the size of an address (e.g.
 ByteOrder byteOrder()
          Retrieves this runtime's native byte order.
 Type findType(NativeType 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
 int longSize()
          Gets the size of a C long integer for this runtime
abstract  void setLastError(int error)
          Sets the native error code.
 
Methods inherited from class jnr.ffi.Runtime
findType, getSystemRuntime, newObjectReferenceManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRuntime

public AbstractRuntime(ByteOrder byteOrder,
                       EnumMap<NativeType,Type> typeMap)
Method Detail

findType

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

Specified by:
findType in class Runtime

getMemoryManager

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

Specified by:
getMemoryManager in class Runtime
Returns:
a MemoryManager

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.

Specified by:
getLastError in class Runtime
Returns:
The errno value.

setLastError

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

Specified by:
setLastError in class Runtime
Parameters:
error - The value to set errno to.

addressMask

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

Specified by:
addressMask in class Runtime

addressSize

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

Specified by:
addressSize in class Runtime
Returns:
The size of an address in bytes.

longSize

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

Specified by:
longSize in class Runtime
Returns:
The size of a C long integer in bytes.

byteOrder

public final ByteOrder byteOrder()
Retrieves this runtime's native byte order.

Specified by:
byteOrder in class Runtime
Returns:
this runtime's byte order


Copyright © 2012. All Rights Reserved.