Class NiceFFI::TypedPointer
In: lib/nice-ffi/typedpointer.rb
Parent: Object

TypedPointer represents a :pointer (FFI type) that is a specific struct type. You can use TypedPointer( SomeStructClass ) instead of :pointer in these situations:

Methods

inspect   new   to_s   unwrap   wrap  

Attributes

type  [R] 

Public Class methods

Create a new TypedPointer whose type is the given struct class.

type must be a class (not an instance) which is a descendent of FFI::Struct (or is FFI::Struct itself).

options must be a Hash of zero or more options. The current meaningful options are:

  • :autorelease - If false, instances of NiceStruct and OpaqueStruct (and subclasses) created via this TypedPointer will be passed {:autorelease => false} to disable automatic memory management. Use this for return values of functions that should not be autoreleased.

Public Instance methods

inspect()

Alias for to_s

Unwrap (i.e. extract the pointer) from a struct of this type.

Wrap a FFI::Pointer in a new struct of this type.

[Validate]