github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/c-deps/libroach/protos/util/hlc/legacy_timestamp.pb.cc (about)

     1  // Generated by the protocol buffer compiler.  DO NOT EDIT!
     2  // source: util/hlc/legacy_timestamp.proto
     3  
     4  #include "util/hlc/legacy_timestamp.pb.h"
     5  
     6  #include <algorithm>
     7  
     8  #include <google/protobuf/stubs/common.h>
     9  #include <google/protobuf/stubs/port.h>
    10  #include <google/protobuf/io/coded_stream.h>
    11  #include <google/protobuf/wire_format_lite_inl.h>
    12  #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
    13  // This is a temporary google only hack
    14  #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
    15  #include "third_party/protobuf/version.h"
    16  #endif
    17  // @@protoc_insertion_point(includes)
    18  
    19  namespace cockroach {
    20  namespace util {
    21  namespace hlc {
    22  class LegacyTimestampDefaultTypeInternal {
    23   public:
    24    ::google::protobuf::internal::ExplicitlyConstructed<LegacyTimestamp>
    25        _instance;
    26  } _LegacyTimestamp_default_instance_;
    27  }  // namespace hlc
    28  }  // namespace util
    29  }  // namespace cockroach
    30  namespace protobuf_util_2fhlc_2flegacy_5ftimestamp_2eproto {
    31  static void InitDefaultsLegacyTimestamp() {
    32    GOOGLE_PROTOBUF_VERIFY_VERSION;
    33  
    34    {
    35      void* ptr = &::cockroach::util::hlc::_LegacyTimestamp_default_instance_;
    36      new (ptr) ::cockroach::util::hlc::LegacyTimestamp();
    37      ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
    38    }
    39    ::cockroach::util::hlc::LegacyTimestamp::InitAsDefaultInstance();
    40  }
    41  
    42  ::google::protobuf::internal::SCCInfo<0> scc_info_LegacyTimestamp =
    43      {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLegacyTimestamp}, {}};
    44  
    45  void InitDefaults() {
    46    ::google::protobuf::internal::InitSCC(&scc_info_LegacyTimestamp.base);
    47  }
    48  
    49  }  // namespace protobuf_util_2fhlc_2flegacy_5ftimestamp_2eproto
    50  namespace cockroach {
    51  namespace util {
    52  namespace hlc {
    53  
    54  // ===================================================================
    55  
    56  void LegacyTimestamp::InitAsDefaultInstance() {
    57  }
    58  #if !defined(_MSC_VER) || _MSC_VER >= 1900
    59  const int LegacyTimestamp::kWallTimeFieldNumber;
    60  const int LegacyTimestamp::kLogicalFieldNumber;
    61  #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
    62  
    63  LegacyTimestamp::LegacyTimestamp()
    64    : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
    65    ::google::protobuf::internal::InitSCC(
    66        &protobuf_util_2fhlc_2flegacy_5ftimestamp_2eproto::scc_info_LegacyTimestamp.base);
    67    SharedCtor();
    68    // @@protoc_insertion_point(constructor:cockroach.util.hlc.LegacyTimestamp)
    69  }
    70  LegacyTimestamp::LegacyTimestamp(const LegacyTimestamp& from)
    71    : ::google::protobuf::MessageLite(),
    72        _internal_metadata_(NULL),
    73        _has_bits_(from._has_bits_) {
    74    _internal_metadata_.MergeFrom(from._internal_metadata_);
    75    ::memcpy(&wall_time_, &from.wall_time_,
    76      static_cast<size_t>(reinterpret_cast<char*>(&logical_) -
    77      reinterpret_cast<char*>(&wall_time_)) + sizeof(logical_));
    78    // @@protoc_insertion_point(copy_constructor:cockroach.util.hlc.LegacyTimestamp)
    79  }
    80  
    81  void LegacyTimestamp::SharedCtor() {
    82    ::memset(&wall_time_, 0, static_cast<size_t>(
    83        reinterpret_cast<char*>(&logical_) -
    84        reinterpret_cast<char*>(&wall_time_)) + sizeof(logical_));
    85  }
    86  
    87  LegacyTimestamp::~LegacyTimestamp() {
    88    // @@protoc_insertion_point(destructor:cockroach.util.hlc.LegacyTimestamp)
    89    SharedDtor();
    90  }
    91  
    92  void LegacyTimestamp::SharedDtor() {
    93  }
    94  
    95  void LegacyTimestamp::SetCachedSize(int size) const {
    96    _cached_size_.Set(size);
    97  }
    98  const LegacyTimestamp& LegacyTimestamp::default_instance() {
    99    ::google::protobuf::internal::InitSCC(&protobuf_util_2fhlc_2flegacy_5ftimestamp_2eproto::scc_info_LegacyTimestamp.base);
   100    return *internal_default_instance();
   101  }
   102  
   103  
   104  void LegacyTimestamp::Clear() {
   105  // @@protoc_insertion_point(message_clear_start:cockroach.util.hlc.LegacyTimestamp)
   106    ::google::protobuf::uint32 cached_has_bits = 0;
   107    // Prevent compiler warnings about cached_has_bits being unused
   108    (void) cached_has_bits;
   109  
   110    cached_has_bits = _has_bits_[0];
   111    if (cached_has_bits & 3u) {
   112      ::memset(&wall_time_, 0, static_cast<size_t>(
   113          reinterpret_cast<char*>(&logical_) -
   114          reinterpret_cast<char*>(&wall_time_)) + sizeof(logical_));
   115    }
   116    _has_bits_.Clear();
   117    _internal_metadata_.Clear();
   118  }
   119  
   120  bool LegacyTimestamp::MergePartialFromCodedStream(
   121      ::google::protobuf::io::CodedInputStream* input) {
   122  #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
   123    ::google::protobuf::uint32 tag;
   124    ::google::protobuf::internal::LiteUnknownFieldSetter unknown_fields_setter(
   125        &_internal_metadata_);
   126    ::google::protobuf::io::StringOutputStream unknown_fields_output(
   127        unknown_fields_setter.buffer());
   128    ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
   129        &unknown_fields_output, false);
   130    // @@protoc_insertion_point(parse_start:cockroach.util.hlc.LegacyTimestamp)
   131    for (;;) {
   132      ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
   133      tag = p.first;
   134      if (!p.second) goto handle_unusual;
   135      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
   136        case 1: {
   137          if (static_cast< ::google::protobuf::uint8>(tag) ==
   138              static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
   139            set_has_wall_time();
   140            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
   141                     ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
   142                   input, &wall_time_)));
   143          } else {
   144            goto handle_unusual;
   145          }
   146          break;
   147        }
   148  
   149        case 2: {
   150          if (static_cast< ::google::protobuf::uint8>(tag) ==
   151              static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
   152            set_has_logical();
   153            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
   154                     ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
   155                   input, &logical_)));
   156          } else {
   157            goto handle_unusual;
   158          }
   159          break;
   160        }
   161  
   162        default: {
   163        handle_unusual:
   164          if (tag == 0) {
   165            goto success;
   166          }
   167          DO_(::google::protobuf::internal::WireFormatLite::SkipField(
   168              input, tag, &unknown_fields_stream));
   169          break;
   170        }
   171      }
   172    }
   173  success:
   174    // @@protoc_insertion_point(parse_success:cockroach.util.hlc.LegacyTimestamp)
   175    return true;
   176  failure:
   177    // @@protoc_insertion_point(parse_failure:cockroach.util.hlc.LegacyTimestamp)
   178    return false;
   179  #undef DO_
   180  }
   181  
   182  void LegacyTimestamp::SerializeWithCachedSizes(
   183      ::google::protobuf::io::CodedOutputStream* output) const {
   184    // @@protoc_insertion_point(serialize_start:cockroach.util.hlc.LegacyTimestamp)
   185    ::google::protobuf::uint32 cached_has_bits = 0;
   186    (void) cached_has_bits;
   187  
   188    cached_has_bits = _has_bits_[0];
   189    if (cached_has_bits & 0x00000001u) {
   190      ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->wall_time(), output);
   191    }
   192  
   193    if (cached_has_bits & 0x00000002u) {
   194      ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->logical(), output);
   195    }
   196  
   197    output->WriteRaw(_internal_metadata_.unknown_fields().data(),
   198                     static_cast<int>(_internal_metadata_.unknown_fields().size()));
   199    // @@protoc_insertion_point(serialize_end:cockroach.util.hlc.LegacyTimestamp)
   200  }
   201  
   202  size_t LegacyTimestamp::ByteSizeLong() const {
   203  // @@protoc_insertion_point(message_byte_size_start:cockroach.util.hlc.LegacyTimestamp)
   204    size_t total_size = 0;
   205  
   206    total_size += _internal_metadata_.unknown_fields().size();
   207  
   208    if (_has_bits_[0 / 32] & 3u) {
   209      if (has_wall_time()) {
   210        total_size += 1 +
   211          ::google::protobuf::internal::WireFormatLite::Int64Size(
   212            this->wall_time());
   213      }
   214  
   215      if (has_logical()) {
   216        total_size += 1 +
   217          ::google::protobuf::internal::WireFormatLite::Int32Size(
   218            this->logical());
   219      }
   220  
   221    }
   222    int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   223    SetCachedSize(cached_size);
   224    return total_size;
   225  }
   226  
   227  void LegacyTimestamp::CheckTypeAndMergeFrom(
   228      const ::google::protobuf::MessageLite& from) {
   229    MergeFrom(*::google::protobuf::down_cast<const LegacyTimestamp*>(&from));
   230  }
   231  
   232  void LegacyTimestamp::MergeFrom(const LegacyTimestamp& from) {
   233  // @@protoc_insertion_point(class_specific_merge_from_start:cockroach.util.hlc.LegacyTimestamp)
   234    GOOGLE_DCHECK_NE(&from, this);
   235    _internal_metadata_.MergeFrom(from._internal_metadata_);
   236    ::google::protobuf::uint32 cached_has_bits = 0;
   237    (void) cached_has_bits;
   238  
   239    cached_has_bits = from._has_bits_[0];
   240    if (cached_has_bits & 3u) {
   241      if (cached_has_bits & 0x00000001u) {
   242        wall_time_ = from.wall_time_;
   243      }
   244      if (cached_has_bits & 0x00000002u) {
   245        logical_ = from.logical_;
   246      }
   247      _has_bits_[0] |= cached_has_bits;
   248    }
   249  }
   250  
   251  void LegacyTimestamp::CopyFrom(const LegacyTimestamp& from) {
   252  // @@protoc_insertion_point(class_specific_copy_from_start:cockroach.util.hlc.LegacyTimestamp)
   253    if (&from == this) return;
   254    Clear();
   255    MergeFrom(from);
   256  }
   257  
   258  bool LegacyTimestamp::IsInitialized() const {
   259    return true;
   260  }
   261  
   262  void LegacyTimestamp::Swap(LegacyTimestamp* other) {
   263    if (other == this) return;
   264    InternalSwap(other);
   265  }
   266  void LegacyTimestamp::InternalSwap(LegacyTimestamp* other) {
   267    using std::swap;
   268    swap(wall_time_, other->wall_time_);
   269    swap(logical_, other->logical_);
   270    swap(_has_bits_[0], other->_has_bits_[0]);
   271    _internal_metadata_.Swap(&other->_internal_metadata_);
   272  }
   273  
   274  ::std::string LegacyTimestamp::GetTypeName() const {
   275    return "cockroach.util.hlc.LegacyTimestamp";
   276  }
   277  
   278  
   279  // @@protoc_insertion_point(namespace_scope)
   280  }  // namespace hlc
   281  }  // namespace util
   282  }  // namespace cockroach
   283  namespace google {
   284  namespace protobuf {
   285  template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::util::hlc::LegacyTimestamp* Arena::CreateMaybeMessage< ::cockroach::util::hlc::LegacyTimestamp >(Arena* arena) {
   286    return Arena::CreateInternal< ::cockroach::util::hlc::LegacyTimestamp >(arena);
   287  }
   288  }  // namespace protobuf
   289  }  // namespace google
   290  
   291  // @@protoc_insertion_point(global_scope)