struct Novika::FFI::StructReferenceType
- Novika::FFI::StructReferenceType
- Novika::FFI::StructType
- Struct
- Value
- Object
Overview
Type-side representation of a struct reference, aka struct
pointer, aka heap-allocated struct (like Crystal class
).
Defined in:
novika/ffi.crInstance Method Summary
-
#alloc : Pointer(Void)
Allocates memory for this type.
- #matches?(pointer : UntypedPointer)
- #matches?(view : StructReferenceView) : Bool
-
#to_ffi_type : Crystal::FFI::Type
Returns the corresponding LibFFI type.
- #to_s(io)
-
#unbox(box : Pointer(Void)) : ForeignValue
Retrieves
ForeignValue
of this type from the given void pointer box. -
#view_for(handle : Pointer(Void)) : StructView
Returns the struct view corresponding to this struct type, wrapped around the given handle.
Instance methods inherited from struct Novika::FFI::StructType
alignment(*args, **options)alignment(*args, **options, &) alignment, from?(form : StructViewForm) from?, make! : StructView make!, padded_size(*args, **options)
padded_size(*args, **options, &) padded_size, references?(*args, **options)
references?(*args, **options, &) references?, to_s(io) to_s, view_for(handle : Pointer(Void)) : StructView view_for
Constructor methods inherited from struct Novika::FFI::StructType
new(layout : StructLayout)
new
Instance methods inherited from module Novika::FFI::ForeignType
alloc : Pointer(Void)
alloc,
from(form : Form) : ForeignValue
from,
from?(form : Form) : ForeignValue | Nil
from?,
matches?(value : ForeignValue) : Bool
matches?,
sizeof : UInt64
sizeof,
to_ffi_type : Crystal::FFI::Type
to_ffi_type,
unbox(box : Pointer(Void)) : ForeignValue
unbox
Instance Method Detail
def alloc : Pointer(Void)
#
Description copied from module Novika::FFI::ForeignType
Allocates memory for this type. Returns a pointer to that memory.
def to_ffi_type : Crystal::FFI::Type
#
Description copied from module Novika::FFI::ForeignType
Returns the corresponding LibFFI type.
def unbox(box : Pointer(Void)) : ForeignValue
#
Description copied from module Novika::FFI::ForeignType
Retrieves ForeignValue
of this type from the given void
pointer box.
def view_for(handle : Pointer(Void)) : StructView
#
Description copied from struct Novika::FFI::StructType
Returns the struct view corresponding to this struct type, wrapped around the given handle.