Class AbstractInvoker

All Implemented Interfaces:
Serializable, Cloneable, Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
Function, JFFIInvoker

public abstract class AbstractInvoker extends Pointer
A native function invoker
See Also:
  • Field Details

    • arity

      protected final Arity arity
      The arity of this function.
  • Constructor Details

    • AbstractInvoker

      protected AbstractInvoker(Ruby runtime, RubyClass klass, int arity, MemoryIO io)
      Creates a new AbstractInvoker instance.
      Parameters:
      runtime - the runtime
      klass - the class
      arity - the arity
      io - the memory
  • Method Details

    • createAbstractInvokerClass

      public static RubyClass createAbstractInvokerClass(ThreadContext context, RubyModule FFI, RubyClass Pointer)
    • attach

      public IRubyObject attach(ThreadContext context, IRubyObject obj, IRubyObject methodName)
      Attaches this function to a ruby module or class.
      Parameters:
      context - The thread context.
      obj - The module or class to attach the function to.
      methodName - The ruby name to attach the function as.
      Returns:
      itself
    • createDynamicMethod

      protected abstract DynamicMethod createDynamicMethod(RubyModule module)
      Create a method
      Parameters:
      module - for which module
      Returns:
      a method
    • getArity

      public final Arity getArity()
      Returns the Arity of this function.
      Returns:
      The Arity of the native function.