org.jruby.ext.ffi
Class NoImplFactory

java.lang.Object
  extended by org.jruby.ext.ffi.Factory
      extended by org.jruby.ext.ffi.NoImplFactory

public class NoImplFactory
extends Factory

An instance of Factory that is used when no FFI implementation can be found.


Constructor Summary
NoImplFactory(java.lang.String msg)
           
 
Method Summary
 int alignmentOf(NativeType type)
           
 AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime, int size, boolean clear)
          Allocates memory on the native C heap and wraps it in a MemoryIO accessor.
 AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime, int size, int align, boolean clear)
          Allocates memory on the native C heap and wraps it in a MemoryIO accessor.
 CallbackManager getCallbackManager()
           
 void init(Ruby runtime, RubyModule ffi)
          Registers FFI ruby classes/modules
 AbstractInvoker newFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo)
           
 int sizeOf(NativeType type)
           
 DirectMemoryIO wrapDirectMemory(Ruby runtime, long address)
          Wraps a native C memory address in a MemoryIO accessor.
 
Methods inherited from class org.jruby.ext.ffi.Factory
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoImplFactory

public NoImplFactory(java.lang.String msg)
Method Detail

init

public void init(Ruby runtime,
                 RubyModule ffi)
Description copied from class: Factory
Registers FFI ruby classes/modules

Overrides:
init in class Factory

allocateDirectMemory

public AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime,
                                                    int size,
                                                    boolean clear)
Description copied from class: Factory
Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Specified by:
allocateDirectMemory in class Factory
size - The number of bytes to allocate.
clear - If the memory should be cleared.
Returns:
A new AllocatedDirectMemoryIO.

allocateDirectMemory

public AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime,
                                                    int size,
                                                    int align,
                                                    boolean clear)
Description copied from class: Factory
Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Specified by:
allocateDirectMemory in class Factory
size - The number of bytes to allocate.
align - The minimum alignment of the memory
clear - If the memory should be cleared.
Returns:
A new AllocatedDirectMemoryIO.

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

newFunction

public AbstractInvoker newFunction(Ruby runtime,
                                   Pointer address,
                                   CallbackInfo cbInfo)
Specified by:
newFunction 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-2009 JRuby Team. All Rights Reserved.