|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.ext.ffi.Type
org.jruby.ext.ffi.StructLayout
public final class StructLayout
Defines the memory layout for a native structure.
Nested Class Summary | |
---|---|
static interface |
StructLayout.Aggregate
|
static class |
StructLayout.Array
|
static class |
StructLayout.Member
A struct member. |
static interface |
StructLayout.Storage
|
Nested classes/interfaces inherited from class org.jruby.ext.ffi.Type |
---|
Type.Builtin |
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Data, RubyObject.ObjectMethods |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer |
Field Summary |
---|
Fields inherited from class org.jruby.ext.ffi.Type |
---|
alignment, nativeType, size |
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_F, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Method Summary | |
---|---|
IRubyObject |
alignment(ThreadContext context)
Gets the minimum alignment of the struct. |
IRubyObject |
aref(ThreadContext context,
IRubyObject fieldName)
|
static RubyClass |
createStructLayoutClass(Ruby runtime,
RubyModule module)
Registers the StructLayout class in the JRuby runtime. |
IRubyObject |
fields(ThreadContext context)
|
IRubyObject |
get(ThreadContext context,
IRubyObject ptr,
IRubyObject name)
Gets the value of the struct member corresponding to name. |
int |
getFieldCount()
|
java.util.Collection<StructLayout.Member> |
getFields()
|
int |
getMinimumAlignment()
|
int |
getSize()
|
IRubyObject |
members(ThreadContext context)
Gets a ruby array of the names of all members of this struct. |
IRubyObject |
offset_of(ThreadContext context,
IRubyObject fieldName)
Gets the offset of a member of the struct. |
IRubyObject |
offsets(ThreadContext context)
Gets a ruby array of the offsets of all members of this struct. |
IRubyObject |
put(ThreadContext context,
IRubyObject ptr,
IRubyObject name,
IRubyObject value)
Sets the native value of the struct member corresponding to name. |
IRubyObject |
size(ThreadContext context)
Gets the total size of the struct. |
Methods inherited from class org.jruby.ext.ffi.Type |
---|
createTypeClass, getNativeAlignment, getNativeSize, getNativeType, getTypeClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static RubyClass createStructLayoutClass(Ruby runtime, RubyModule module)
runtime
- The JRuby runtime to register the new class in.
public IRubyObject get(ThreadContext context, IRubyObject ptr, IRubyObject name)
ptr
- The address of the structure in memory.name
- The name of the member.
public IRubyObject put(ThreadContext context, IRubyObject ptr, IRubyObject name, IRubyObject value)
ptr
- The address of the structure in memory.name
- The name of the member.
public IRubyObject members(ThreadContext context)
public IRubyObject offsets(ThreadContext context)
public IRubyObject size(ThreadContext context)
size
in class Type
context
- The Ruby thread context.
public IRubyObject alignment(ThreadContext context)
alignment
in class Type
context
- The Ruby thread context.
public IRubyObject offset_of(ThreadContext context, IRubyObject fieldName)
public IRubyObject aref(ThreadContext context, IRubyObject fieldName)
public IRubyObject fields(ThreadContext context)
public final int getMinimumAlignment()
public final int getSize()
public final int getFieldCount()
public final java.util.Collection<StructLayout.Member> getFields()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |