org.jruby.ext.ffi.jna
Class Factory
java.lang.Object
org.jruby.ext.ffi.Factory
org.jruby.ext.ffi.jna.Factory
public class Factory
- extends Factory
An implementation of FFI for JNA
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Factory
public Factory()
init
public void init(Ruby runtime,
RubyModule ffi)
- Description copied from class:
Factory
- Registers FFI ruby classes/modules
- Overrides:
init
in class Factory
loadLibrary
public <T> T loadLibrary(java.lang.String libraryName,
java.lang.Class<T> libraryClass)
- Description copied from class:
Factory
- Loads a native library.
- Specified by:
loadLibrary
in class Factory
- Parameters:
libraryName
- The name of the library to load.libraryClass
- The interface class to map to the library functions.
- Returns:
- A new instance of libraryClass that an access the library.
allocateDirectMemory
public AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime,
int size,
boolean clear)
- Allocates memory on the native C heap and wraps it in a MemoryIO accessor.
- Specified by:
allocateDirectMemory
in class Factory
- Parameters:
size
- The number of bytes to allocate.clear
- If the memory should be cleared.
- Returns:
- A new MemoryIO.
wrapDirectMemory
public DirectMemoryIO wrapDirectMemory(Ruby runtime,
long address)
- Description copied from class:
Factory
- Wraps a native C memory address in a MemoryIO accessor.
- Specified by:
wrapDirectMemory
in class Factory
address
- The native address to wrap.
- Returns:
- A new MemoryIO.
getCallbackManager
public CallbackManager getCallbackManager()
- Specified by:
getCallbackManager
in class Factory
sizeOf
public int sizeOf(NativeType type)
- Specified by:
sizeOf
in class Factory
alignmentOf
public int alignmentOf(NativeType type)
- Specified by:
alignmentOf
in class Factory
Copyright © 2002-2007 JRuby Team. All Rights Reserved.