Class: H3::Bindings::Types::H3IndexesIn

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/h3/bindings/types.rb

Direct Known Subclasses

H3IndexesOut

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(set) ⇒ H3IndexesIn

Returns a new instance of H3IndexesIn.



40
41
42
43
# File 'lib/h3/bindings/types.rb', line 40

def initialize(set)
  @size = set.size
  ptr.write_array_of_ulong_long(set)
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



38
39
40
# File 'lib/h3/bindings/types.rb', line 38

def size
  @size
end

Class Method Details

.to_native(h3_set_in, _context) ⇒ Object



34
35
36
# File 'lib/h3/bindings/types.rb', line 34

def self.to_native(h3_set_in, _context)
  h3_set_in.ptr
end

Instance Method Details

#ptrObject



45
46
47
# File 'lib/h3/bindings/types.rb', line 45

def ptr
  @ptr ||= FFI::MemoryPointer.new(:ulong_long, size)
end