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

#include "histogram_event.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_histogram_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto;
namespace metrics {
class HistogramEventProto_BucketDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HistogramEventProto_Bucket> _instance;
} _HistogramEventProto_Bucket_default_instance_;
class HistogramEventProtoDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HistogramEventProto> _instance;
} _HistogramEventProto_default_instance_;
}  // namespace metrics
static void InitDefaultsscc_info_HistogramEventProto_histogram_5fevent_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::metrics::_HistogramEventProto_default_instance_;
    new (ptr) ::metrics::HistogramEventProto();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::metrics::HistogramEventProto::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HistogramEventProto_histogram_5fevent_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_HistogramEventProto_histogram_5fevent_2eproto}, {
      &scc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto.base,}};

static void InitDefaultsscc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::metrics::_HistogramEventProto_Bucket_default_instance_;
    new (ptr) ::metrics::HistogramEventProto_Bucket();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::metrics::HistogramEventProto_Bucket::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto}, {}};

namespace metrics {

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

void HistogramEventProto_Bucket::InitAsDefaultInstance() {
}
class HistogramEventProto_Bucket::_Internal {
 public:
  using HasBits = decltype(std::declval<HistogramEventProto_Bucket>()._has_bits_);
  static void set_has_min(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_max(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_count(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

HistogramEventProto_Bucket::HistogramEventProto_Bucket()
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:metrics.HistogramEventProto.Bucket)
}
HistogramEventProto_Bucket::HistogramEventProto_Bucket(const HistogramEventProto_Bucket& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&min_, &from.min_,
    static_cast<size_t>(reinterpret_cast<char*>(&count_) -
    reinterpret_cast<char*>(&min_)) + sizeof(count_));
  // @@protoc_insertion_point(copy_constructor:metrics.HistogramEventProto.Bucket)
}

void HistogramEventProto_Bucket::SharedCtor() {
  ::memset(&min_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&max_) -
      reinterpret_cast<char*>(&min_)) + sizeof(max_));
  count_ = PROTOBUF_LONGLONG(1);
}

HistogramEventProto_Bucket::~HistogramEventProto_Bucket() {
  // @@protoc_insertion_point(destructor:metrics.HistogramEventProto.Bucket)
  SharedDtor();
}

void HistogramEventProto_Bucket::SharedDtor() {
}

void HistogramEventProto_Bucket::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const HistogramEventProto_Bucket& HistogramEventProto_Bucket::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HistogramEventProto_Bucket_histogram_5fevent_2eproto.base);
  return *internal_default_instance();
}


void HistogramEventProto_Bucket::Clear() {
// @@protoc_insertion_point(message_clear_start:metrics.HistogramEventProto.Bucket)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    ::memset(&min_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&max_) -
        reinterpret_cast<char*>(&min_)) + sizeof(max_));
    count_ = PROTOBUF_LONGLONG(1);
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* HistogramEventProto_Bucket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional int64 min = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_min(&has_bits);
          min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 max = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_max(&has_bits);
          max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 count = 4 [default = 1];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_count(&has_bits);
          count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool HistogramEventProto_Bucket::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  ::PROTOBUF_NAMESPACE_ID::internal::LiteUnknownFieldSetter unknown_fields_setter(
      &_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::io::StringOutputStream unknown_fields_output(
      unknown_fields_setter.buffer());
  ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream unknown_fields_stream(
      &unknown_fields_output, false);
  // @@protoc_insertion_point(parse_start:metrics.HistogramEventProto.Bucket)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int64 min = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
          _Internal::set_has_min(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &min_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 max = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          _Internal::set_has_max(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &max_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 count = 4 [default = 1];
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
          _Internal::set_has_count(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &count_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SkipField(
            input, tag, &unknown_fields_stream));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:metrics.HistogramEventProto.Bucket)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:metrics.HistogramEventProto.Bucket)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void HistogramEventProto_Bucket::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:metrics.HistogramEventProto.Bucket)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 min = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->min(), output);
  }

  // optional int64 max = 2;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->max(), output);
  }

  // optional int64 count = 4 [default = 1];
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->count(), output);
  }

  output->WriteRaw(_internal_metadata_.unknown_fields().data(),
                   static_cast<int>(_internal_metadata_.unknown_fields().size()));
  // @@protoc_insertion_point(serialize_end:metrics.HistogramEventProto.Bucket)
}

size_t HistogramEventProto_Bucket::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:metrics.HistogramEventProto.Bucket)
  size_t total_size = 0;

  total_size += _internal_metadata_.unknown_fields().size();

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

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional int64 min = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->min());
    }

    // optional int64 max = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->max());
    }

    // optional int64 count = 4 [default = 1];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->count());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HistogramEventProto_Bucket::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HistogramEventProto_Bucket*>(
      &from));
}

void HistogramEventProto_Bucket::MergeFrom(const HistogramEventProto_Bucket& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:metrics.HistogramEventProto.Bucket)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      min_ = from.min_;
    }
    if (cached_has_bits & 0x00000002u) {
      max_ = from.max_;
    }
    if (cached_has_bits & 0x00000004u) {
      count_ = from.count_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void HistogramEventProto_Bucket::CopyFrom(const HistogramEventProto_Bucket& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:metrics.HistogramEventProto.Bucket)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void HistogramEventProto_Bucket::InternalSwap(HistogramEventProto_Bucket* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  swap(min_, other->min_);
  swap(max_, other->max_);
  swap(count_, other->count_);
}

std::string HistogramEventProto_Bucket::GetTypeName() const {
  return "metrics.HistogramEventProto.Bucket";
}


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

void HistogramEventProto::InitAsDefaultInstance() {
}
class HistogramEventProto::_Internal {
 public:
  using HasBits = decltype(std::declval<HistogramEventProto>()._has_bits_);
  static void set_has_name_hash(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_sum(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

HistogramEventProto::HistogramEventProto()
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:metrics.HistogramEventProto)
}
HistogramEventProto::HistogramEventProto(const HistogramEventProto& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_),
      bucket_(from.bucket_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&name_hash_, &from.name_hash_,
    static_cast<size_t>(reinterpret_cast<char*>(&sum_) -
    reinterpret_cast<char*>(&name_hash_)) + sizeof(sum_));
  // @@protoc_insertion_point(copy_constructor:metrics.HistogramEventProto)
}

void HistogramEventProto::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HistogramEventProto_histogram_5fevent_2eproto.base);
  ::memset(&name_hash_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&sum_) -
      reinterpret_cast<char*>(&name_hash_)) + sizeof(sum_));
}

HistogramEventProto::~HistogramEventProto() {
  // @@protoc_insertion_point(destructor:metrics.HistogramEventProto)
  SharedDtor();
}

void HistogramEventProto::SharedDtor() {
}

void HistogramEventProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const HistogramEventProto& HistogramEventProto::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HistogramEventProto_histogram_5fevent_2eproto.base);
  return *internal_default_instance();
}


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

  bucket_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    ::memset(&name_hash_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&sum_) -
        reinterpret_cast<char*>(&name_hash_)) + sizeof(sum_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* HistogramEventProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional fixed64 name_hash = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 9)) {
          _Internal::set_has_name_hash(&has_bits);
          name_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr);
          ptr += sizeof(::PROTOBUF_NAMESPACE_ID::uint64);
        } else goto handle_unusual;
        continue;
      // optional int64 sum = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_sum(&has_bits);
          sum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.HistogramEventProto.Bucket bucket = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_bucket(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool HistogramEventProto::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  ::PROTOBUF_NAMESPACE_ID::internal::LiteUnknownFieldSetter unknown_fields_setter(
      &_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::io::StringOutputStream unknown_fields_output(
      unknown_fields_setter.buffer());
  ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream unknown_fields_stream(
      &unknown_fields_output, false);
  // @@protoc_insertion_point(parse_start:metrics.HistogramEventProto)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional fixed64 name_hash = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (9 & 0xFF)) {
          _Internal::set_has_name_hash(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FIXED64>(
                 input, &name_hash_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 sum = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          _Internal::set_has_sum(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &sum_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.HistogramEventProto.Bucket bucket = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_bucket()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SkipField(
            input, tag, &unknown_fields_stream));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:metrics.HistogramEventProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:metrics.HistogramEventProto)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void HistogramEventProto::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:metrics.HistogramEventProto)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional fixed64 name_hash = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed64(1, this->name_hash(), output);
  }

  // optional int64 sum = 2;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->sum(), output);
  }

  // repeated .metrics.HistogramEventProto.Bucket bucket = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->bucket_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      3,
      this->bucket(static_cast<int>(i)),
      output);
  }

  output->WriteRaw(_internal_metadata_.unknown_fields().data(),
                   static_cast<int>(_internal_metadata_.unknown_fields().size()));
  // @@protoc_insertion_point(serialize_end:metrics.HistogramEventProto)
}

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

  total_size += _internal_metadata_.unknown_fields().size();

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

  // repeated .metrics.HistogramEventProto.Bucket bucket = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->bucket_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->bucket(static_cast<int>(i)));
    }
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    // optional fixed64 name_hash = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 + 8;
    }

    // optional int64 sum = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->sum());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HistogramEventProto::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HistogramEventProto*>(
      &from));
}

void HistogramEventProto::MergeFrom(const HistogramEventProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:metrics.HistogramEventProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  bucket_.MergeFrom(from.bucket_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      name_hash_ = from.name_hash_;
    }
    if (cached_has_bits & 0x00000002u) {
      sum_ = from.sum_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

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

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

void HistogramEventProto::InternalSwap(HistogramEventProto* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  CastToBase(&bucket_)->InternalSwap(CastToBase(&other->bucket_));
  swap(name_hash_, other->name_hash_);
  swap(sum_, other->sum_);
}

std::string HistogramEventProto::GetTypeName() const {
  return "metrics.HistogramEventProto";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace metrics
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::metrics::HistogramEventProto_Bucket* Arena::CreateMaybeMessage< ::metrics::HistogramEventProto_Bucket >(Arena* arena) {
  return Arena::CreateInternal< ::metrics::HistogramEventProto_Bucket >(arena);
}
template<> PROTOBUF_NOINLINE ::metrics::HistogramEventProto* Arena::CreateMaybeMessage< ::metrics::HistogramEventProto >(Arena* arena) {
  return Arena::CreateInternal< ::metrics::HistogramEventProto >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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