Top Inners Constructors Methods
org.jruby.ext.ffi.jffi

public Class Factory

extends Factory
Class Inheritance
Imports
com.kenai.jffi.CallingConvention, org.jruby.Ruby, .RubyClass, .RubyModule, org.jruby.anno.JRubyMethod, org.jruby.api.Access, org.jruby.ext.ffi.*, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.platform.Platform

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
public MemoryIO

Returns:

A new MemoryIO.
allocateDirectMemory
(Ruby runtime, int
The number of bytes to allocate.
size
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

public MemoryIO

Returns:

A new MemoryIO.
allocateDirectMemory
(Ruby runtime, int
The number of bytes to allocate.
size
,
int
The minimum alignment of the memory
align
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

public MemoryIO
allocateTransientDirectMemory(Ruby runtime, int
The number of bytes to allocate.
size
,
int
The minimum alignment of the memory
align
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Allocates transient native memory (not from C heap) and wraps it in a MemoryIO accessor.

public CallbackManager
private static final Type
public void
init(Ruby
The ruby runtime
runtime
,
RubyModule
the module to register the classes under
FFI
)

Overrides org.jruby.ext.ffi.Factory.init.

Registers FFI ruby classes/modules

public Function
newFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo)

Implements abstract org.jruby.ext.ffi.Factory.newFunction.

public int
public MemoryIO
wrapDirectMemory(Ruby runtime, long
The native address to wrap.
address
)

Implements abstract org.jruby.ext.ffi.Factory.wrapDirectMemory.

Wraps a native C memory address in a MemoryIO accessor.

Inherited from org.jruby.ext.ffi.Factory:
getInstance

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

alignmentOfback to summary
public int alignmentOf(NativeType type)

Implements abstract org.jruby.ext.ffi.Factory.alignmentOf.

allocateDirectMemoryback to summary
public MemoryIO allocateDirectMemory(Ruby runtime, int size, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new MemoryIO.

allocateDirectMemoryback to summary
public MemoryIO allocateDirectMemory(Ruby runtime, int size, int align, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

align:int

The minimum alignment of the memory

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new MemoryIO.

allocateTransientDirectMemoryback to summary
public MemoryIO allocateTransientDirectMemory(Ruby runtime, int size, int align, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Doc from org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Allocates transient native memory (not from C heap) and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

align:int

The minimum alignment of the memory

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new AllocatedDirectMemoryIO.

getCallbackManagerback to summary
public CallbackManager getCallbackManager()

Implements abstract org.jruby.ext.ffi.Factory.getCallbackManager.

Annotations
@Override
getTypeback to summary
private static final Type getType(NativeType type)
initback to summary
public void init(Ruby runtime, RubyModule FFI)

Overrides org.jruby.ext.ffi.Factory.init.

Doc from org.jruby.ext.ffi.Factory.init.

Registers FFI ruby classes/modules

Parameters
runtime:Ruby

The ruby runtime

FFI:RubyModule

the module to register the classes under

Annotations
@Override
newFunctionback to summary
public Function newFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo)

Implements abstract org.jruby.ext.ffi.Factory.newFunction.

Annotations
@Override
sizeOfback to summary
public int sizeOf(NativeType type)

Implements abstract org.jruby.ext.ffi.Factory.sizeOf.

wrapDirectMemoryback to summary
public MemoryIO wrapDirectMemory(Ruby runtime, long address)

Implements abstract org.jruby.ext.ffi.Factory.wrapDirectMemory.

Doc from org.jruby.ext.ffi.Factory.wrapDirectMemory.

Wraps a native C memory address in a MemoryIO accessor.

Parameters
address:long

The native address to wrap.

Returns:MemoryIO

A new MemoryIO.

org.jruby.ext.ffi.jffi back to summary

public final Class Factory.LastError

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final IRubyObject
public static final IRubyObject
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LastErrorback to summary
public LastError()

Method Detail

errorback to summary
public static final IRubyObject error(ThreadContext context, IRubyObject recv)
Annotations
@JRubyMethod
name:error
module:true
error_setback to summary
public static final IRubyObject error_set(ThreadContext context, IRubyObject recv, IRubyObject value)
Annotations
@JRubyMethod
name:error=
module:true
org.jruby.ext.ffi.jffi back to summary

public final Class Factory.WinapiLastError

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final IRubyObject
public static final IRubyObject
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WinapiLastErrorback to summary
public WinapiLastError()

Method Detail

winapi_errorback to summary
public static final IRubyObject winapi_error(ThreadContext context, IRubyObject recv)
Annotations
@JRubyMethod
name:winapi_error
module:true
winapi_error_setback to summary
public static final IRubyObject winapi_error_set(ThreadContext context, IRubyObject recv, IRubyObject value)
Annotations
@JRubyMethod
name:winapi_error=
module:true