Class: ArrowFormat::Org::Apache::Arrow::Flatbuf::Message
- Inherits:
-
FlatBuffers::RootTable
- Object
- FlatBuffers::RootTable
- ArrowFormat::Org::Apache::Arrow::Flatbuf::Message
- Defined in:
- lib/arrow-format/org/apache/arrow/flatbuf/message.rb
Constant Summary collapse
- FIELDS =
{ version: ::FlatBuffers::Field.new(:version, 0, 4, :short, 0), header_type: ::FlatBuffers::Field.new(:header_type, 1, 6, :utype, 0), header: ::FlatBuffers::Field.new(:header, 2, 8, "::ArrowFormat::Org::Apache::Arrow::Flatbuf::MessageHeader", 0), body_length: ::FlatBuffers::Field.new(:body_length, 3, 10, :long, 0), custom_metadata: ::FlatBuffers::Field.new(:custom_metadata, 4, 12, ["::ArrowFormat::Org::Apache::Arrow::Flatbuf::KeyValue"], 0), }
- Data =
define_data_class
Class Method Summary collapse
Instance Method Summary collapse
- #body_length ⇒ Object
- #custom_metadata ⇒ Object
- #header ⇒ Object
- #header_type ⇒ Object
- #version ⇒ Object
Class Method Details
.file_extension ⇒ Object
23 24 25 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 23 def file_extension "" end |
.file_identifier ⇒ Object
19 20 21 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 19 def file_identifier "" end |
Instance Method Details
#body_length ⇒ Object
38 39 40 41 42 43 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 38 def body_length field_offset = @view.unpack_virtual_offset(10) return 0 if field_offset.zero? @view.unpack_long(field_offset) end |
#custom_metadata ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 45 def field_offset = @view.unpack_virtual_offset(12) return nil if field_offset.zero? element_size = 4 @view.unpack_vector(field_offset, element_size) do |element_offset| @view.unpack_table(::ArrowFormat::Org::Apache::Arrow::Flatbuf::KeyValue, element_offset) end end |
#header ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 55 def header type = header_type return nil if type.nil? field_offset = @view.unpack_virtual_offset(8) return nil if field_offset.zero? @view.unpack_union(type.table_class, field_offset) end |
#header_type ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 64 def header_type field_offset = @view.unpack_virtual_offset(6) if field_offset.zero? enum_value = 0 else enum_value = @view.unpack_utype(field_offset) end ::ArrowFormat::Org::Apache::Arrow::Flatbuf::MessageHeader.try_convert(enum_value) || enum_value end |
#version ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/arrow-format/org/apache/arrow/flatbuf/message.rb', line 74 def version field_offset = @view.unpack_virtual_offset(4) if field_offset.zero? enum_value = 0 else enum_value = @view.unpack_short(field_offset) end ::ArrowFormat::Org::Apache::Arrow::Flatbuf::MetadataVersion.try_convert(enum_value) || enum_value end |