Top Description Fields Constructors Methods
org.jruby.ext.ffi

public abstract Class AbstractInvoker

extends Pointer
Class Inheritance
Known Direct Subclasses
org.jruby.ext.ffi.jffi.Function, org.jruby.ext.ffi.jffi.JFFIInvoker, org.jruby.ext.ffi.jffi.NativeCallbackPointer
Annotations
@JRubyClass
name:FFI::AbstractInvoker
parent:Object
Imports
org.jruby.Ruby, .RubyClass, .RubyModule, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.internal.runtime.methods.DynamicMethod, org.jruby.runtime.Arity, .ThreadContext, org.jruby.runtime.builtin.IRubyObject

A native function invoker

Field Summary

Modifier and TypeField and Description
protected final Arity
arity

The arity of this function.

pack-priv static final String

Constructor Summary

AccessConstructor and Description
protected
AbstractInvoker(Ruby
the runtime
runtime
,
RubyClass
the class
klass
,
int
the arity
arity
,
MemoryIO
the memory
io
)

Creates a new AbstractInvoker instance.

Method Summary

Modifier and TypeMethod and Description
public IRubyObject

Returns:

itself
attach
(ThreadContext
The thread context.
context
,
IRubyObject
The module or class to attach the function to.
obj
,
IRubyObject
The ruby name to attach the function as.
methodName
)

Attaches this function to a ruby module or class.

public static RubyClass
protected abstract DynamicMethod

Returns:

a method
createDynamicMethod
(RubyModule
for which module
module
)

Create a method

public final Arity

Returns:

The Arity of the native function.
getArity
()

Returns the org.jruby.runtime.Arity of this function.

Inherited from org.jruby.ext.ffi.Pointer:
addresscreatePointerClassgetAddressgetNullgetPointergetPointerClassinitializeinitializeinitialize_copynull_pop_equalordersizeslicesliceto_s

Field Detail

arityback to summary
protected final Arity arity

The arity of this function.

CLASS_NAMEback to summary
pack-priv static final String CLASS_NAME

Constructor Detail

AbstractInvokerback to summary
protected AbstractInvoker(Ruby runtime, RubyClass klass, int arity, MemoryIO io)

Creates a new AbstractInvoker instance.

Parameters
runtime:Ruby

the runtime

klass:RubyClass

the class

arity:int

the arity

io:MemoryIO

the memory

Method Detail

attachback to summary
public IRubyObject attach(ThreadContext context, IRubyObject obj, IRubyObject methodName)

Attaches this function to a ruby module or class.

Parameters
context:ThreadContext

The thread context.

obj:IRubyObject

The module or class to attach the function to.

methodName:IRubyObject

The ruby name to attach the function as.

Returns:IRubyObject

itself

Annotations
@JRubyMethod
name:attach
createAbstractInvokerClassback to summary
public static RubyClass createAbstractInvokerClass(ThreadContext context, RubyModule FFI, RubyClass Pointer)
createDynamicMethodback to summary
protected abstract DynamicMethod createDynamicMethod(RubyModule module)

Create a method

Parameters
module:RubyModule

for which module

Returns:DynamicMethod

a method

getArityback to summary
public final Arity getArity()

Returns the org.jruby.runtime.Arity of this function.

Returns:Arity

The Arity of the native function.