// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: ReadRequest.proto

#include "ReadRequest.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace request {
constexpr ReadRequest::ReadRequest(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : filepath_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , numberofbytestoread_(0)
  , offset_(0){}
struct ReadRequestDefaultTypeInternal {
  constexpr ReadRequestDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ReadRequestDefaultTypeInternal() {}
  union {
    ReadRequest _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReadRequestDefaultTypeInternal _ReadRequest_default_instance_;
}  // namespace request
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ReadRequest_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_ReadRequest_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_ReadRequest_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_ReadRequest_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::request::ReadRequest, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::request::ReadRequest, filepath_),
  PROTOBUF_FIELD_OFFSET(::request::ReadRequest, numberofbytestoread_),
  PROTOBUF_FIELD_OFFSET(::request::ReadRequest, offset_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::request::ReadRequest)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::request::_ReadRequest_default_instance_),
};

const char descriptor_table_protodef_ReadRequest_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\021ReadRequest.proto\022\007request\"L\n\013ReadRequ"
  "est\022\020\n\010filepath\030\001 \001(\t\022\033\n\023numberOfBytesTo"
  "Read\030\002 \001(\005\022\016\n\006offset\030\003 \001(\005BAZ\?github.com"
  "/MartinSimango/goftqproto/internal/reque"
  "st/genrequestb\006proto3"
  ;
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ReadRequest_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ReadRequest_2eproto = {
  false, false, 181, descriptor_table_protodef_ReadRequest_2eproto, "ReadRequest.proto", 
  &descriptor_table_ReadRequest_2eproto_once, nullptr, 0, 1,
  schemas, file_default_instances, TableStruct_ReadRequest_2eproto::offsets,
  file_level_metadata_ReadRequest_2eproto, file_level_enum_descriptors_ReadRequest_2eproto, file_level_service_descriptors_ReadRequest_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_ReadRequest_2eproto_getter() {
  return &descriptor_table_ReadRequest_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_ReadRequest_2eproto(&descriptor_table_ReadRequest_2eproto);
namespace request {

// ===================================================================

class ReadRequest::_Internal {
 public:
};

ReadRequest::ReadRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:request.ReadRequest)
}
ReadRequest::ReadRequest(const ReadRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  filepath_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_filepath().empty()) {
    filepath_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_filepath(), 
      GetArenaForAllocation());
  }
  ::memcpy(&numberofbytestoread_, &from.numberofbytestoread_,
    static_cast<size_t>(reinterpret_cast<char*>(&offset_) -
    reinterpret_cast<char*>(&numberofbytestoread_)) + sizeof(offset_));
  // @@protoc_insertion_point(copy_constructor:request.ReadRequest)
}

void ReadRequest::SharedCtor() {
filepath_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&numberofbytestoread_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&offset_) -
    reinterpret_cast<char*>(&numberofbytestoread_)) + sizeof(offset_));
}

ReadRequest::~ReadRequest() {
  // @@protoc_insertion_point(destructor:request.ReadRequest)
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

void ReadRequest::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  filepath_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void ReadRequest::ArenaDtor(void* object) {
  ReadRequest* _this = reinterpret_cast< ReadRequest* >(object);
  (void)_this;
}
void ReadRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void ReadRequest::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void ReadRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:request.ReadRequest)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  filepath_.ClearToEmpty();
  ::memset(&numberofbytestoread_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&offset_) -
      reinterpret_cast<char*>(&numberofbytestoread_)) + sizeof(offset_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* ReadRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string filepath = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_filepath();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "request.ReadRequest.filepath"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // int32 numberOfBytesToRead = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          numberofbytestoread_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // int32 offset = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag == 0) || ((tag & 7) == 4)) {
          CHK_(ptr);
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* ReadRequest::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:request.ReadRequest)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string filepath = 1;
  if (!this->filepath().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_filepath().data(), static_cast<int>(this->_internal_filepath().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "request.ReadRequest.filepath");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_filepath(), target);
  }

  // int32 numberOfBytesToRead = 2;
  if (this->numberofbytestoread() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_numberofbytestoread(), target);
  }

  // int32 offset = 3;
  if (this->offset() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_offset(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:request.ReadRequest)
  return target;
}

size_t ReadRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:request.ReadRequest)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // string filepath = 1;
  if (!this->filepath().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_filepath());
  }

  // int32 numberOfBytesToRead = 2;
  if (this->numberofbytestoread() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
        this->_internal_numberofbytestoread());
  }

  // int32 offset = 3;
  if (this->offset() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
        this->_internal_offset());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ReadRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:request.ReadRequest)
  GOOGLE_DCHECK_NE(&from, this);
  const ReadRequest* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReadRequest>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:request.ReadRequest)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:request.ReadRequest)
    MergeFrom(*source);
  }
}

void ReadRequest::MergeFrom(const ReadRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:request.ReadRequest)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from.filepath().empty()) {
    _internal_set_filepath(from._internal_filepath());
  }
  if (from.numberofbytestoread() != 0) {
    _internal_set_numberofbytestoread(from._internal_numberofbytestoread());
  }
  if (from.offset() != 0) {
    _internal_set_offset(from._internal_offset());
  }
}

void ReadRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:request.ReadRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ReadRequest::CopyFrom(const ReadRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:request.ReadRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ReadRequest::IsInitialized() const {
  return true;
}

void ReadRequest::InternalSwap(ReadRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &filepath_, GetArenaForAllocation(),
      &other->filepath_, other->GetArenaForAllocation()
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ReadRequest, offset_)
      + sizeof(ReadRequest::offset_)
      - PROTOBUF_FIELD_OFFSET(ReadRequest, numberofbytestoread_)>(
          reinterpret_cast<char*>(&numberofbytestoread_),
          reinterpret_cast<char*>(&other->numberofbytestoread_));
}

::PROTOBUF_NAMESPACE_ID::Metadata ReadRequest::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_ReadRequest_2eproto_getter, &descriptor_table_ReadRequest_2eproto_once,
      file_level_metadata_ReadRequest_2eproto[0]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace request
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::request::ReadRequest* Arena::CreateMaybeMessage< ::request::ReadRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::request::ReadRequest >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
