Module: Rufus::Tokyo::ListMapMixin

:nodoc:

Public Visibility

Public Instance Method Summary

#clib

A shortcut.

#outlen_op(method, *args)
#pointer

Returns the underlying ‘native’ (FFI) memory pointer.

#pointer_or_raise

Public Instance Method Details

clib

public clib

A shortcut

[View source]


38
39
40
41
# File 'lib/rufus/tokyo/cabinet/util.rb', line 38

def clib

  CabinetLib
end

outlen_op

public outlen_op(method, *args)
[View source]


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rufus/tokyo/cabinet/util.rb', line 55

def outlen_op (method, *args)

  args.unshift(pointer_or_raise)

  outlen = FFI::MemoryPointer.new(:int)
  args << outlen

  out = clib.send(method, *args)

  return nil if out.address == 0

  return out.get_bytes(0, outlen.get_int(0))

ensure

  outlen.free
end

pointer

public pointer

Returns the underlying ‘native’ (FFI) memory pointer

[View source]


45
46
47
48
# File 'lib/rufus/tokyo/cabinet/util.rb', line 45

def pointer

  @pointer
end

pointer_or_raise

public pointer_or_raise
[View source]


50
51
52
53
# File 'lib/rufus/tokyo/cabinet/util.rb', line 50

def pointer_or_raise

  @pointer || raise("#{self.class} got freed, cannot use anymore")
end
Generated on Friday, September 18 2009 at 10:35:40 AM by YARD 0.2.3.5 (ruby-1.8.7).