1// automatically generated by the FlatBuffers compiler, do not modify
2
3
4#ifndef FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_
5#define FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_
6
7#include "flatbuffers/flatbuffers.h"
8
9#include "Schema_generated.h"
10
11namespace org {
12namespace apache {
13namespace arrow {
14namespace flatbuf {
15
16struct Footer;
17
18struct Block;
19
20FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Block FLATBUFFERS_FINAL_CLASS {
21 private:
22 int64_t offset_;
23 int32_t metaDataLength_;
24 int32_t padding0__;
25 int64_t bodyLength_;
26
27 public:
28 Block() {
29 memset(static_cast<void *>(this), 0, sizeof(Block));
30 }
31 Block(int64_t _offset, int32_t _metaDataLength, int64_t _bodyLength)
32 : offset_(flatbuffers::EndianScalar(_offset)),
33 metaDataLength_(flatbuffers::EndianScalar(_metaDataLength)),
34 padding0__(0),
35 bodyLength_(flatbuffers::EndianScalar(_bodyLength)) {
36 (void)padding0__;
37 }
38 /// Index to the start of the RecordBlock (note this is past the Message header)
39 int64_t offset() const {
40 return flatbuffers::EndianScalar(offset_);
41 }
42 /// Length of the metadata
43 int32_t metaDataLength() const {
44 return flatbuffers::EndianScalar(metaDataLength_);
45 }
46 /// Length of the data (this is aligned so there can be a gap between this and
47 /// the metatdata).
48 int64_t bodyLength() const {
49 return flatbuffers::EndianScalar(bodyLength_);
50 }
51};
52FLATBUFFERS_STRUCT_END(Block, 24);
53
54/// ----------------------------------------------------------------------
55/// Arrow File metadata
56///
57struct Footer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
58 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
59 VT_VERSION = 4,
60 VT_SCHEMA = 6,
61 VT_DICTIONARIES = 8,
62 VT_RECORDBATCHES = 10
63 };
64 MetadataVersion version() const {
65 return static_cast<MetadataVersion>(GetField<int16_t>(VT_VERSION, 0));
66 }
67 const Schema *schema() const {
68 return GetPointer<const Schema *>(VT_SCHEMA);
69 }
70 const flatbuffers::Vector<const Block *> *dictionaries() const {
71 return GetPointer<const flatbuffers::Vector<const Block *> *>(VT_DICTIONARIES);
72 }
73 const flatbuffers::Vector<const Block *> *recordBatches() const {
74 return GetPointer<const flatbuffers::Vector<const Block *> *>(VT_RECORDBATCHES);
75 }
76 bool Verify(flatbuffers::Verifier &verifier) const {
77 return VerifyTableStart(verifier) &&
78 VerifyField<int16_t>(verifier, VT_VERSION) &&
79 VerifyOffset(verifier, VT_SCHEMA) &&
80 verifier.VerifyTable(schema()) &&
81 VerifyOffset(verifier, VT_DICTIONARIES) &&
82 verifier.VerifyVector(dictionaries()) &&
83 VerifyOffset(verifier, VT_RECORDBATCHES) &&
84 verifier.VerifyVector(recordBatches()) &&
85 verifier.EndTable();
86 }
87};
88
89struct FooterBuilder {
90 flatbuffers::FlatBufferBuilder &fbb_;
91 flatbuffers::uoffset_t start_;
92 void add_version(MetadataVersion version) {
93 fbb_.AddElement<int16_t>(Footer::VT_VERSION, static_cast<int16_t>(version), 0);
94 }
95 void add_schema(flatbuffers::Offset<Schema> schema) {
96 fbb_.AddOffset(Footer::VT_SCHEMA, schema);
97 }
98 void add_dictionaries(flatbuffers::Offset<flatbuffers::Vector<const Block *>> dictionaries) {
99 fbb_.AddOffset(Footer::VT_DICTIONARIES, dictionaries);
100 }
101 void add_recordBatches(flatbuffers::Offset<flatbuffers::Vector<const Block *>> recordBatches) {
102 fbb_.AddOffset(Footer::VT_RECORDBATCHES, recordBatches);
103 }
104 explicit FooterBuilder(flatbuffers::FlatBufferBuilder &_fbb)
105 : fbb_(_fbb) {
106 start_ = fbb_.StartTable();
107 }
108 FooterBuilder &operator=(const FooterBuilder &);
109 flatbuffers::Offset<Footer> Finish() {
110 const auto end = fbb_.EndTable(start_);
111 auto o = flatbuffers::Offset<Footer>(end);
112 return o;
113 }
114};
115
116inline flatbuffers::Offset<Footer> CreateFooter(
117 flatbuffers::FlatBufferBuilder &_fbb,
118 MetadataVersion version = MetadataVersion_V1,
119 flatbuffers::Offset<Schema> schema = 0,
120 flatbuffers::Offset<flatbuffers::Vector<const Block *>> dictionaries = 0,
121 flatbuffers::Offset<flatbuffers::Vector<const Block *>> recordBatches = 0) {
122 FooterBuilder builder_(_fbb);
123 builder_.add_recordBatches(recordBatches);
124 builder_.add_dictionaries(dictionaries);
125 builder_.add_schema(schema);
126 builder_.add_version(version);
127 return builder_.Finish();
128}
129
130inline flatbuffers::Offset<Footer> CreateFooterDirect(
131 flatbuffers::FlatBufferBuilder &_fbb,
132 MetadataVersion version = MetadataVersion_V1,
133 flatbuffers::Offset<Schema> schema = 0,
134 const std::vector<Block> *dictionaries = nullptr,
135 const std::vector<Block> *recordBatches = nullptr) {
136 auto dictionaries__ = dictionaries ? _fbb.CreateVectorOfStructs<Block>(*dictionaries) : 0;
137 auto recordBatches__ = recordBatches ? _fbb.CreateVectorOfStructs<Block>(*recordBatches) : 0;
138 return org::apache::arrow::flatbuf::CreateFooter(
139 _fbb,
140 version,
141 schema,
142 dictionaries__,
143 recordBatches__);
144}
145
146inline const org::apache::arrow::flatbuf::Footer *GetFooter(const void *buf) {
147 return flatbuffers::GetRoot<org::apache::arrow::flatbuf::Footer>(buf);
148}
149
150inline const org::apache::arrow::flatbuf::Footer *GetSizePrefixedFooter(const void *buf) {
151 return flatbuffers::GetSizePrefixedRoot<org::apache::arrow::flatbuf::Footer>(buf);
152}
153
154inline bool VerifyFooterBuffer(
155 flatbuffers::Verifier &verifier) {
156 return verifier.VerifyBuffer<org::apache::arrow::flatbuf::Footer>(nullptr);
157}
158
159inline bool VerifySizePrefixedFooterBuffer(
160 flatbuffers::Verifier &verifier) {
161 return verifier.VerifySizePrefixedBuffer<org::apache::arrow::flatbuf::Footer>(nullptr);
162}
163
164inline void FinishFooterBuffer(
165 flatbuffers::FlatBufferBuilder &fbb,
166 flatbuffers::Offset<org::apache::arrow::flatbuf::Footer> root) {
167 fbb.Finish(root);
168}
169
170inline void FinishSizePrefixedFooterBuffer(
171 flatbuffers::FlatBufferBuilder &fbb,
172 flatbuffers::Offset<org::apache::arrow::flatbuf::Footer> root) {
173 fbb.FinishSizePrefixed(root);
174}
175
176} // namespace flatbuf
177} // namespace arrow
178} // namespace apache
179} // namespace org
180
181#endif // FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_
182