// automatically generated by the FlatBuffers compiler, do not modify


#ifndef FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_
#define FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_

#include "flatbuffers/flatbuffers.h"

#include "Schema_generated.h"

namespace org {
namespace apache {
namespace arrow {
namespace flatbuf {

struct Footer;

struct Block;

FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Block FLATBUFFERS_FINAL_CLASS {
 private:
  int64_t offset_;
  int32_t metaDataLength_;
  int32_t padding0__;
  int64_t bodyLength_;

 public:
  Block() {
    memset(this, 0, sizeof(Block));
  }
  Block(int64_t _offset, int32_t _metaDataLength, int64_t _bodyLength)
      : offset_(flatbuffers::EndianScalar(_offset)),
        metaDataLength_(flatbuffers::EndianScalar(_metaDataLength)),
        padding0__(0),
        bodyLength_(flatbuffers::EndianScalar(_bodyLength)) {
    (void)padding0__;
  }
  /// Index to the start of the RecordBlock (note this is past the Message header)
  int64_t offset() const {
    return flatbuffers::EndianScalar(offset_);
  }
  /// Length of the metadata
  int32_t metaDataLength() const {
    return flatbuffers::EndianScalar(metaDataLength_);
  }
  /// Length of the data (this is aligned so there can be a gap between this and
  /// the metatdata).
  int64_t bodyLength() const {
    return flatbuffers::EndianScalar(bodyLength_);
  }
};
FLATBUFFERS_STRUCT_END(Block, 24);

/// ----------------------------------------------------------------------
/// Arrow File metadata
///
struct Footer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  enum {
    VT_VERSION = 4,
    VT_SCHEMA = 6,
    VT_DICTIONARIES = 8,
    VT_RECORDBATCHES = 10
  };
  MetadataVersion version() const {
    return static_cast<MetadataVersion>(GetField<int16_t>(VT_VERSION, 0));
  }
  const Schema *schema() const {
    return GetPointer<const Schema *>(VT_SCHEMA);
  }
  const flatbuffers::Vector<const Block *> *dictionaries() const {
    return GetPointer<const flatbuffers::Vector<const Block *> *>(VT_DICTIONARIES);
  }
  const flatbuffers::Vector<const Block *> *recordBatches() const {
    return GetPointer<const flatbuffers::Vector<const Block *> *>(VT_RECORDBATCHES);
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int16_t>(verifier, VT_VERSION) &&
           VerifyOffset(verifier, VT_SCHEMA) &&
           verifier.VerifyTable(schema()) &&
           VerifyOffset(verifier, VT_DICTIONARIES) &&
           verifier.VerifyVector(dictionaries()) &&
           VerifyOffset(verifier, VT_RECORDBATCHES) &&
           verifier.VerifyVector(recordBatches()) &&
           verifier.EndTable();
  }
};

struct FooterBuilder {
  flatbuffers::FlatBufferBuilder &fbb_;
  flatbuffers::uoffset_t start_;
  void add_version(MetadataVersion version) {
    fbb_.AddElement<int16_t>(Footer::VT_VERSION, static_cast<int16_t>(version), 0);
  }
  void add_schema(flatbuffers::Offset<Schema> schema) {
    fbb_.AddOffset(Footer::VT_SCHEMA, schema);
  }
  void add_dictionaries(flatbuffers::Offset<flatbuffers::Vector<const Block *>> dictionaries) {
    fbb_.AddOffset(Footer::VT_DICTIONARIES, dictionaries);
  }
  void add_recordBatches(flatbuffers::Offset<flatbuffers::Vector<const Block *>> recordBatches) {
    fbb_.AddOffset(Footer::VT_RECORDBATCHES, recordBatches);
  }
  explicit FooterBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  FooterBuilder &operator=(const FooterBuilder &);
  flatbuffers::Offset<Footer> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<Footer>(end);
    return o;
  }
};

inline flatbuffers::Offset<Footer> CreateFooter(
    flatbuffers::FlatBufferBuilder &_fbb,
    MetadataVersion version = MetadataVersion_V1,
    flatbuffers::Offset<Schema> schema = 0,
    flatbuffers::Offset<flatbuffers::Vector<const Block *>> dictionaries = 0,
    flatbuffers::Offset<flatbuffers::Vector<const Block *>> recordBatches = 0) {
  FooterBuilder builder_(_fbb);
  builder_.add_recordBatches(recordBatches);
  builder_.add_dictionaries(dictionaries);
  builder_.add_schema(schema);
  builder_.add_version(version);
  return builder_.Finish();
}

inline flatbuffers::Offset<Footer> CreateFooterDirect(
    flatbuffers::FlatBufferBuilder &_fbb,
    MetadataVersion version = MetadataVersion_V1,
    flatbuffers::Offset<Schema> schema = 0,
    const std::vector<Block> *dictionaries = nullptr,
    const std::vector<Block> *recordBatches = nullptr) {
  return org::apache::arrow::flatbuf::CreateFooter(
      _fbb,
      version,
      schema,
      dictionaries ? _fbb.CreateVectorOfStructs<Block>(*dictionaries) : 0,
      recordBatches ? _fbb.CreateVectorOfStructs<Block>(*recordBatches) : 0);
}

inline const org::apache::arrow::flatbuf::Footer *GetFooter(const void *buf) {
  return flatbuffers::GetRoot<org::apache::arrow::flatbuf::Footer>(buf);
}

inline const org::apache::arrow::flatbuf::Footer *GetSizePrefixedFooter(const void *buf) {
  return flatbuffers::GetSizePrefixedRoot<org::apache::arrow::flatbuf::Footer>(buf);
}

inline bool VerifyFooterBuffer(
    flatbuffers::Verifier &verifier) {
  return verifier.VerifyBuffer<org::apache::arrow::flatbuf::Footer>(nullptr);
}

inline bool VerifySizePrefixedFooterBuffer(
    flatbuffers::Verifier &verifier) {
  return verifier.VerifySizePrefixedBuffer<org::apache::arrow::flatbuf::Footer>(nullptr);
}

inline void FinishFooterBuffer(
    flatbuffers::FlatBufferBuilder &fbb,
    flatbuffers::Offset<org::apache::arrow::flatbuf::Footer> root) {
  fbb.Finish(root);
}

inline void FinishSizePrefixedFooterBuffer(
    flatbuffers::FlatBufferBuilder &fbb,
    flatbuffers::Offset<org::apache::arrow::flatbuf::Footer> root) {
  fbb.FinishSizePrefixed(root);
}

}  // namespace flatbuf
}  // namespace arrow
}  // namespace apache
}  // namespace org

#endif  // FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_
