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