Package org.jruby.ext.ffi
Interface StructLayout.FieldIO
- All Known Implementing Classes:
StructLayout.ArrayFieldIO,StructLayout.DefaultFieldIO,StructLayout.EnumFieldIO,StructLayout.FunctionFieldIO,StructLayout.InnerStructFieldIO,StructLayout.MappedFieldIO,StructLayout.NumberFieldIO,StructLayout.PointerFieldIO,StructLayout.StringFieldIO
- Enclosing class:
- StructLayout
static interface StructLayout.FieldIO
-
Method Summary
Modifier and TypeMethodDescriptionget(ThreadContext context, StructLayout.Storage cache, StructLayout.Member m, AbstractMemory ptr) Reads a ruby value from the struct member.booleanGets the cacheable status of this Struct memberbooleanChecks if a reference to the ruby object assigned to this field needs to be storedvoidput(ThreadContext context, StructLayout.Storage cache, StructLayout.Member m, AbstractMemory ptr, IRubyObject value) Writes a ruby value to the native struct member as the appropriate native value.
-
Method Details
-
put
void put(ThreadContext context, StructLayout.Storage cache, StructLayout.Member m, AbstractMemory ptr, IRubyObject value) Writes a ruby value to the native struct member as the appropriate native value.- Parameters:
context- the current contextcache- The value cacheptr- The struct memory area.value- The ruby value to write to the native struct member.
-
get
IRubyObject get(ThreadContext context, StructLayout.Storage cache, StructLayout.Member m, AbstractMemory ptr) Reads a ruby value from the struct member.- Parameters:
cache- The cache used to storeptr- The struct memory area.- Returns:
- A ruby object equivalent to the native member value.
-
isCacheable
boolean isCacheable()Gets the cacheable status of this Struct member- Returns:
- true if this member type is cacheable
-
isValueReferenceNeeded
boolean isValueReferenceNeeded()Checks if a reference to the ruby object assigned to this field needs to be stored- Returns:
- true if this member type requires the ruby value to be stored.
-