class GirFFI::BoxedBase

Base class for generated classes representing boxed types.

Public Class Methods

copy(val) click to toggle source
# File lib/gir_ffi/boxed_base.rb, line 21
def self.copy(val)
  ptr = GObject.boxed_copy(gtype, val)
  wrap(ptr)
end
make_finalizer(struct) click to toggle source
# File lib/gir_ffi/boxed_base.rb, line 12
def self.make_finalizer(struct)
  proc do
    if struct.owned?
      struct.owned = nil
      GObject.boxed_free gtype, struct.to_ptr
    end
  end
end
new() click to toggle source
# File lib/gir_ffi/boxed_base.rb, line 8
def initialize
  store_pointer(nil)
end

Private Instance Methods

make_finalizer() click to toggle source
# File lib/gir_ffi/boxed_base.rb, line 33
def make_finalizer
  ObjectSpace.define_finalizer self, self.class.make_finalizer(struct)
end
store_pointer(*) click to toggle source
Calls superclass method
# File lib/gir_ffi/boxed_base.rb, line 28
def store_pointer(*)
  super
  make_finalizer
end