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

#include "monitor_info.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 _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace fleet {
PROTOBUF_CONSTEXPR MonitorInfo::MonitorInfo(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.roadside_id_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.longitude_)*/0
  , /*decltype(_impl_.latitude_)*/0
  , /*decltype(_impl_.timestamp_)*/uint64_t{0u}
  , /*decltype(_impl_.status_)*/0
  , /*decltype(_impl_.battery_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct MonitorInfoDefaultTypeInternal {
  PROTOBUF_CONSTEXPR MonitorInfoDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~MonitorInfoDefaultTypeInternal() {}
  union {
    MonitorInfo _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MonitorInfoDefaultTypeInternal _MonitorInfo_default_instance_;
}  // namespace fleet
static ::_pb::Metadata file_level_metadata_monitor_5finfo_2eproto[1];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_monitor_5finfo_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_monitor_5finfo_2eproto = nullptr;

const uint32_t TableStruct_monitor_5finfo_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.roadside_id_),
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.longitude_),
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.latitude_),
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.timestamp_),
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.status_),
  PROTOBUF_FIELD_OFFSET(::fleet::MonitorInfo, _impl_.battery_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::fleet::MonitorInfo)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::fleet::_MonitorInfo_default_instance_._instance,
};

const char descriptor_table_protodef_monitor_5finfo_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\022monitor_info.proto\022\005fleet\"\222\001\n\013MonitorI"
  "nfo\022\023\n\013roadside_id\030\001 \001(\t\022\021\n\tlongitude\030\002 "
  "\001(\001\022\020\n\010latitude\030\003 \001(\001\022\021\n\ttimestamp\030\004 \001(\004"
  "\022%\n\006status\030\005 \001(\0162\025.fleet.RoadsideStatus\022"
  "\017\n\007battery\030\006 \001(\002*H\n\016RoadsideStatus\022\022\n\016UN"
  "KNOWN_STATUS\020\000\022\n\n\006ONLINE\020\001\022\013\n\007OFFLINE\020\002\022"
  "\t\n\005FAULT\020\003b\006proto3"
  ;
static ::_pbi::once_flag descriptor_table_monitor_5finfo_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_monitor_5finfo_2eproto = {
    false, false, 258, descriptor_table_protodef_monitor_5finfo_2eproto,
    "monitor_info.proto",
    &descriptor_table_monitor_5finfo_2eproto_once, nullptr, 0, 1,
    schemas, file_default_instances, TableStruct_monitor_5finfo_2eproto::offsets,
    file_level_metadata_monitor_5finfo_2eproto, file_level_enum_descriptors_monitor_5finfo_2eproto,
    file_level_service_descriptors_monitor_5finfo_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_monitor_5finfo_2eproto_getter() {
  return &descriptor_table_monitor_5finfo_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_monitor_5finfo_2eproto(&descriptor_table_monitor_5finfo_2eproto);
namespace fleet {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RoadsideStatus_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_monitor_5finfo_2eproto);
  return file_level_enum_descriptors_monitor_5finfo_2eproto[0];
}
bool RoadsideStatus_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}


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

class MonitorInfo::_Internal {
 public:
};

MonitorInfo::MonitorInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:fleet.MonitorInfo)
}
MonitorInfo::MonitorInfo(const MonitorInfo& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  MonitorInfo* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.roadside_id_){}
    , decltype(_impl_.longitude_){}
    , decltype(_impl_.latitude_){}
    , decltype(_impl_.timestamp_){}
    , decltype(_impl_.status_){}
    , decltype(_impl_.battery_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.roadside_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.roadside_id_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_roadside_id().empty()) {
    _this->_impl_.roadside_id_.Set(from._internal_roadside_id(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.longitude_, &from._impl_.longitude_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.battery_) -
    reinterpret_cast<char*>(&_impl_.longitude_)) + sizeof(_impl_.battery_));
  // @@protoc_insertion_point(copy_constructor:fleet.MonitorInfo)
}

inline void MonitorInfo::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.roadside_id_){}
    , decltype(_impl_.longitude_){0}
    , decltype(_impl_.latitude_){0}
    , decltype(_impl_.timestamp_){uint64_t{0u}}
    , decltype(_impl_.status_){0}
    , decltype(_impl_.battery_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.roadside_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.roadside_id_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

MonitorInfo::~MonitorInfo() {
  // @@protoc_insertion_point(destructor:fleet.MonitorInfo)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void MonitorInfo::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.roadside_id_.Destroy();
}

void MonitorInfo::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void MonitorInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:fleet.MonitorInfo)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.roadside_id_.ClearToEmpty();
  ::memset(&_impl_.longitude_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.battery_) -
      reinterpret_cast<char*>(&_impl_.longitude_)) + sizeof(_impl_.battery_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* MonitorInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string roadside_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_roadside_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "fleet.MonitorInfo.roadside_id"));
        } else
          goto handle_unusual;
        continue;
      // double longitude = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 17)) {
          _impl_.longitude_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double latitude = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 25)) {
          _impl_.latitude_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // uint64 timestamp = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .fleet.RoadsideStatus status = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_status(static_cast<::fleet::RoadsideStatus>(val));
        } else
          goto handle_unusual;
        continue;
      // float battery = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
          _impl_.battery_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* MonitorInfo::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:fleet.MonitorInfo)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // double longitude = 2;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_longitude = this->_internal_longitude();
  uint64_t raw_longitude;
  memcpy(&raw_longitude, &tmp_longitude, sizeof(tmp_longitude));
  if (raw_longitude != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_longitude(), target);
  }

  // double latitude = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_latitude = this->_internal_latitude();
  uint64_t raw_latitude;
  memcpy(&raw_latitude, &tmp_latitude, sizeof(tmp_latitude));
  if (raw_latitude != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_latitude(), target);
  }

  // uint64 timestamp = 4;
  if (this->_internal_timestamp() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_timestamp(), target);
  }

  // .fleet.RoadsideStatus status = 5;
  if (this->_internal_status() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      5, this->_internal_status(), target);
  }

  // float battery = 6;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_battery = this->_internal_battery();
  uint32_t raw_battery;
  memcpy(&raw_battery, &tmp_battery, sizeof(tmp_battery));
  if (raw_battery != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(6, this->_internal_battery(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::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:fleet.MonitorInfo)
  return target;
}

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

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

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

  // double longitude = 2;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_longitude = this->_internal_longitude();
  uint64_t raw_longitude;
  memcpy(&raw_longitude, &tmp_longitude, sizeof(tmp_longitude));
  if (raw_longitude != 0) {
    total_size += 1 + 8;
  }

  // double latitude = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_latitude = this->_internal_latitude();
  uint64_t raw_latitude;
  memcpy(&raw_latitude, &tmp_latitude, sizeof(tmp_latitude));
  if (raw_latitude != 0) {
    total_size += 1 + 8;
  }

  // uint64 timestamp = 4;
  if (this->_internal_timestamp() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp());
  }

  // .fleet.RoadsideStatus status = 5;
  if (this->_internal_status() != 0) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_status());
  }

  // float battery = 6;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_battery = this->_internal_battery();
  uint32_t raw_battery;
  memcpy(&raw_battery, &tmp_battery, sizeof(tmp_battery));
  if (raw_battery != 0) {
    total_size += 1 + 4;
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MonitorInfo::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    MonitorInfo::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MonitorInfo::GetClassData() const { return &_class_data_; }


void MonitorInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<MonitorInfo*>(&to_msg);
  auto& from = static_cast<const MonitorInfo&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:fleet.MonitorInfo)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_roadside_id().empty()) {
    _this->_internal_set_roadside_id(from._internal_roadside_id());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_longitude = from._internal_longitude();
  uint64_t raw_longitude;
  memcpy(&raw_longitude, &tmp_longitude, sizeof(tmp_longitude));
  if (raw_longitude != 0) {
    _this->_internal_set_longitude(from._internal_longitude());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_latitude = from._internal_latitude();
  uint64_t raw_latitude;
  memcpy(&raw_latitude, &tmp_latitude, sizeof(tmp_latitude));
  if (raw_latitude != 0) {
    _this->_internal_set_latitude(from._internal_latitude());
  }
  if (from._internal_timestamp() != 0) {
    _this->_internal_set_timestamp(from._internal_timestamp());
  }
  if (from._internal_status() != 0) {
    _this->_internal_set_status(from._internal_status());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_battery = from._internal_battery();
  uint32_t raw_battery;
  memcpy(&raw_battery, &tmp_battery, sizeof(tmp_battery));
  if (raw_battery != 0) {
    _this->_internal_set_battery(from._internal_battery());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void MonitorInfo::InternalSwap(MonitorInfo* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.roadside_id_, lhs_arena,
      &other->_impl_.roadside_id_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(MonitorInfo, _impl_.battery_)
      + sizeof(MonitorInfo::_impl_.battery_)
      - PROTOBUF_FIELD_OFFSET(MonitorInfo, _impl_.longitude_)>(
          reinterpret_cast<char*>(&_impl_.longitude_),
          reinterpret_cast<char*>(&other->_impl_.longitude_));
}

::PROTOBUF_NAMESPACE_ID::Metadata MonitorInfo::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_monitor_5finfo_2eproto_getter, &descriptor_table_monitor_5finfo_2eproto_once,
      file_level_metadata_monitor_5finfo_2eproto[0]);
}

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

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