| OLD | NEW |
| (Empty) |
| 1 // Generated by the protocol buffer compiler. DO NOT EDIT! | |
| 2 // source: google/protobuf/timestamp.proto | |
| 3 | |
| 4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION | |
| 5 #include "google/protobuf/timestamp.pb.h" | |
| 6 | |
| 7 #include <algorithm> | |
| 8 | |
| 9 #include <google/protobuf/stubs/common.h> | |
| 10 #include <google/protobuf/stubs/once.h> | |
| 11 #include <google/protobuf/io/coded_stream.h> | |
| 12 #include <google/protobuf/wire_format_lite_inl.h> | |
| 13 #include <google/protobuf/descriptor.h> | |
| 14 #include <google/protobuf/generated_message_reflection.h> | |
| 15 #include <google/protobuf/reflection_ops.h> | |
| 16 #include <google/protobuf/wire_format.h> | |
| 17 // @@protoc_insertion_point(includes) | |
| 18 | |
| 19 namespace google { | |
| 20 namespace protobuf { | |
| 21 | |
| 22 namespace { | |
| 23 | |
| 24 const ::google::protobuf::Descriptor* Timestamp_descriptor_ = NULL; | |
| 25 const ::google::protobuf::internal::GeneratedMessageReflection* | |
| 26 Timestamp_reflection_ = NULL; | |
| 27 | |
| 28 } // namespace | |
| 29 | |
| 30 | |
| 31 void protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 32 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); | |
| 33 const ::google::protobuf::FileDescriptor* file = | |
| 34 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( | |
| 35 "google/protobuf/timestamp.proto"); | |
| 36 GOOGLE_CHECK(file != NULL); | |
| 37 Timestamp_descriptor_ = file->message_type(0); | |
| 38 static const int Timestamp_offsets_[2] = { | |
| 39 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), | |
| 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), | |
| 41 }; | |
| 42 Timestamp_reflection_ = | |
| 43 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessag
eReflection( | |
| 44 Timestamp_descriptor_, | |
| 45 Timestamp::default_instance_, | |
| 46 Timestamp_offsets_, | |
| 47 -1, | |
| 48 -1, | |
| 49 -1, | |
| 50 sizeof(Timestamp), | |
| 51 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metada
ta_), | |
| 52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _is_default_inst
ance_)); | |
| 53 } | |
| 54 | |
| 55 namespace { | |
| 56 | |
| 57 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); | |
| 58 inline void protobuf_AssignDescriptorsOnce() { | |
| 59 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, | |
| 60 &protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto); | |
| 61 } | |
| 62 | |
| 63 void protobuf_RegisterTypes(const ::std::string&) { | |
| 64 protobuf_AssignDescriptorsOnce(); | |
| 65 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( | |
| 66 Timestamp_descriptor_, &Timestamp::default_instance()); | |
| 67 } | |
| 68 | |
| 69 } // namespace | |
| 70 | |
| 71 void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 72 delete Timestamp::default_instance_; | |
| 73 delete Timestamp_reflection_; | |
| 74 } | |
| 75 | |
| 76 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 77 static bool already_here = false; | |
| 78 if (already_here) return; | |
| 79 already_here = true; | |
| 80 GOOGLE_PROTOBUF_VERIFY_VERSION; | |
| 81 | |
| 82 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( | |
| 83 "\n\037google/protobuf/timestamp.proto\022\017googl" | |
| 84 "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" | |
| 85 "\022\r\n\005nanos\030\002 \001(\005BQ\n\023com.google.protobufB\016" | |
| 86 "TimestampProtoP\001\240\001\001\242\002\003GPB\252\002\036Google.Proto" | |
| 87 "buf.WellKnownTypesb\006proto3", 186); | |
| 88 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( | |
| 89 "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); | |
| 90 Timestamp::default_instance_ = new Timestamp(); | |
| 91 Timestamp::default_instance_->InitAsDefaultInstance(); | |
| 92 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2ftimestamp_2eproto); | |
| 93 } | |
| 94 | |
| 95 // Force AddDescriptors() to be called at static initialization time. | |
| 96 struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto { | |
| 97 StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 98 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); | |
| 99 } | |
| 100 } static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_; | |
| 101 | |
| 102 namespace { | |
| 103 | |
| 104 static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; | |
| 105 static void MergeFromFail(int line) { | |
| 106 GOOGLE_CHECK(false) << __FILE__ << ":" << line; | |
| 107 } | |
| 108 | |
| 109 } // namespace | |
| 110 | |
| 111 | |
| 112 // =================================================================== | |
| 113 | |
| 114 #ifndef _MSC_VER | |
| 115 const int Timestamp::kSecondsFieldNumber; | |
| 116 const int Timestamp::kNanosFieldNumber; | |
| 117 #endif // !_MSC_VER | |
| 118 | |
| 119 Timestamp::Timestamp() | |
| 120 : ::google::protobuf::Message(), _internal_metadata_(NULL) { | |
| 121 SharedCtor(); | |
| 122 // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) | |
| 123 } | |
| 124 | |
| 125 void Timestamp::InitAsDefaultInstance() { | |
| 126 _is_default_instance_ = true; | |
| 127 } | |
| 128 | |
| 129 Timestamp::Timestamp(const Timestamp& from) | |
| 130 : ::google::protobuf::Message(), | |
| 131 _internal_metadata_(NULL) { | |
| 132 SharedCtor(); | |
| 133 MergeFrom(from); | |
| 134 // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp) | |
| 135 } | |
| 136 | |
| 137 void Timestamp::SharedCtor() { | |
| 138 _is_default_instance_ = false; | |
| 139 _cached_size_ = 0; | |
| 140 seconds_ = GOOGLE_LONGLONG(0); | |
| 141 nanos_ = 0; | |
| 142 } | |
| 143 | |
| 144 Timestamp::~Timestamp() { | |
| 145 // @@protoc_insertion_point(destructor:google.protobuf.Timestamp) | |
| 146 SharedDtor(); | |
| 147 } | |
| 148 | |
| 149 void Timestamp::SharedDtor() { | |
| 150 if (this != default_instance_) { | |
| 151 } | |
| 152 } | |
| 153 | |
| 154 void Timestamp::SetCachedSize(int size) const { | |
| 155 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | |
| 156 _cached_size_ = size; | |
| 157 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | |
| 158 } | |
| 159 const ::google::protobuf::Descriptor* Timestamp::descriptor() { | |
| 160 protobuf_AssignDescriptorsOnce(); | |
| 161 return Timestamp_descriptor_; | |
| 162 } | |
| 163 | |
| 164 const Timestamp& Timestamp::default_instance() { | |
| 165 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftimestamp_
2eproto(); | |
| 166 return *default_instance_; | |
| 167 } | |
| 168 | |
| 169 Timestamp* Timestamp::default_instance_ = NULL; | |
| 170 | |
| 171 Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const { | |
| 172 Timestamp* n = new Timestamp; | |
| 173 if (arena != NULL) { | |
| 174 arena->Own(n); | |
| 175 } | |
| 176 return n; | |
| 177 } | |
| 178 | |
| 179 void Timestamp::Clear() { | |
| 180 #define ZR_HELPER_(f) reinterpret_cast<char*>(\ | |
| 181 &reinterpret_cast<Timestamp*>(16)->f) | |
| 182 | |
| 183 #define ZR_(first, last) do {\ | |
| 184 ::memset(&first, 0,\ | |
| 185 ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ | |
| 186 } while (0) | |
| 187 | |
| 188 ZR_(seconds_, nanos_); | |
| 189 | |
| 190 #undef ZR_HELPER_ | |
| 191 #undef ZR_ | |
| 192 | |
| 193 } | |
| 194 | |
| 195 bool Timestamp::MergePartialFromCodedStream( | |
| 196 ::google::protobuf::io::CodedInputStream* input) { | |
| 197 #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure | |
| 198 ::google::protobuf::uint32 tag; | |
| 199 // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp) | |
| 200 for (;;) { | |
| 201 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(
127); | |
| 202 tag = p.first; | |
| 203 if (!p.second) goto handle_unusual; | |
| 204 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { | |
| 205 // optional int64 seconds = 1; | |
| 206 case 1: { | |
| 207 if (tag == 8) { | |
| 208 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | |
| 209 ::google::protobuf::int64, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT64>( | |
| 210 input, &seconds_))); | |
| 211 | |
| 212 } else { | |
| 213 goto handle_unusual; | |
| 214 } | |
| 215 if (input->ExpectTag(16)) goto parse_nanos; | |
| 216 break; | |
| 217 } | |
| 218 | |
| 219 // optional int32 nanos = 2; | |
| 220 case 2: { | |
| 221 if (tag == 16) { | |
| 222 parse_nanos: | |
| 223 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | |
| 224 ::google::protobuf::int32, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT32>( | |
| 225 input, &nanos_))); | |
| 226 | |
| 227 } else { | |
| 228 goto handle_unusual; | |
| 229 } | |
| 230 if (input->ExpectAtEnd()) goto success; | |
| 231 break; | |
| 232 } | |
| 233 | |
| 234 default: { | |
| 235 handle_unusual: | |
| 236 if (tag == 0 || | |
| 237 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == | |
| 238 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { | |
| 239 goto success; | |
| 240 } | |
| 241 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; | |
| 242 break; | |
| 243 } | |
| 244 } | |
| 245 } | |
| 246 success: | |
| 247 // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp) | |
| 248 return true; | |
| 249 failure: | |
| 250 // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp) | |
| 251 return false; | |
| 252 #undef DO_ | |
| 253 } | |
| 254 | |
| 255 void Timestamp::SerializeWithCachedSizes( | |
| 256 ::google::protobuf::io::CodedOutputStream* output) const { | |
| 257 // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp) | |
| 258 // optional int64 seconds = 1; | |
| 259 if (this->seconds() != 0) { | |
| 260 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(),
output); | |
| 261 } | |
| 262 | |
| 263 // optional int32 nanos = 2; | |
| 264 if (this->nanos() != 0) { | |
| 265 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), o
utput); | |
| 266 } | |
| 267 | |
| 268 // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp) | |
| 269 } | |
| 270 | |
| 271 ::google::protobuf::uint8* Timestamp::SerializeWithCachedSizesToArray( | |
| 272 ::google::protobuf::uint8* target) const { | |
| 273 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp
) | |
| 274 // optional int64 seconds = 1; | |
| 275 if (this->seconds() != 0) { | |
| 276 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1,
this->seconds(), target); | |
| 277 } | |
| 278 | |
| 279 // optional int32 nanos = 2; | |
| 280 if (this->nanos() != 0) { | |
| 281 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2,
this->nanos(), target); | |
| 282 } | |
| 283 | |
| 284 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp) | |
| 285 return target; | |
| 286 } | |
| 287 | |
| 288 int Timestamp::ByteSize() const { | |
| 289 int total_size = 0; | |
| 290 | |
| 291 // optional int64 seconds = 1; | |
| 292 if (this->seconds() != 0) { | |
| 293 total_size += 1 + | |
| 294 ::google::protobuf::internal::WireFormatLite::Int64Size( | |
| 295 this->seconds()); | |
| 296 } | |
| 297 | |
| 298 // optional int32 nanos = 2; | |
| 299 if (this->nanos() != 0) { | |
| 300 total_size += 1 + | |
| 301 ::google::protobuf::internal::WireFormatLite::Int32Size( | |
| 302 this->nanos()); | |
| 303 } | |
| 304 | |
| 305 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | |
| 306 _cached_size_ = total_size; | |
| 307 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | |
| 308 return total_size; | |
| 309 } | |
| 310 | |
| 311 void Timestamp::MergeFrom(const ::google::protobuf::Message& from) { | |
| 312 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); | |
| 313 const Timestamp* source = | |
| 314 ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>( | |
| 315 &from); | |
| 316 if (source == NULL) { | |
| 317 ::google::protobuf::internal::ReflectionOps::Merge(from, this); | |
| 318 } else { | |
| 319 MergeFrom(*source); | |
| 320 } | |
| 321 } | |
| 322 | |
| 323 void Timestamp::MergeFrom(const Timestamp& from) { | |
| 324 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); | |
| 325 if (from.seconds() != 0) { | |
| 326 set_seconds(from.seconds()); | |
| 327 } | |
| 328 if (from.nanos() != 0) { | |
| 329 set_nanos(from.nanos()); | |
| 330 } | |
| 331 } | |
| 332 | |
| 333 void Timestamp::CopyFrom(const ::google::protobuf::Message& from) { | |
| 334 if (&from == this) return; | |
| 335 Clear(); | |
| 336 MergeFrom(from); | |
| 337 } | |
| 338 | |
| 339 void Timestamp::CopyFrom(const Timestamp& from) { | |
| 340 if (&from == this) return; | |
| 341 Clear(); | |
| 342 MergeFrom(from); | |
| 343 } | |
| 344 | |
| 345 bool Timestamp::IsInitialized() const { | |
| 346 | |
| 347 return true; | |
| 348 } | |
| 349 | |
| 350 void Timestamp::Swap(Timestamp* other) { | |
| 351 if (other == this) return; | |
| 352 InternalSwap(other); | |
| 353 } | |
| 354 void Timestamp::InternalSwap(Timestamp* other) { | |
| 355 std::swap(seconds_, other->seconds_); | |
| 356 std::swap(nanos_, other->nanos_); | |
| 357 _internal_metadata_.Swap(&other->_internal_metadata_); | |
| 358 std::swap(_cached_size_, other->_cached_size_); | |
| 359 } | |
| 360 | |
| 361 ::google::protobuf::Metadata Timestamp::GetMetadata() const { | |
| 362 protobuf_AssignDescriptorsOnce(); | |
| 363 ::google::protobuf::Metadata metadata; | |
| 364 metadata.descriptor = Timestamp_descriptor_; | |
| 365 metadata.reflection = Timestamp_reflection_; | |
| 366 return metadata; | |
| 367 } | |
| 368 | |
| 369 #if PROTOBUF_INLINE_NOT_IN_HEADERS | |
| 370 // Timestamp | |
| 371 | |
| 372 // optional int64 seconds = 1; | |
| 373 void Timestamp::clear_seconds() { | |
| 374 seconds_ = GOOGLE_LONGLONG(0); | |
| 375 } | |
| 376 ::google::protobuf::int64 Timestamp::seconds() const { | |
| 377 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds) | |
| 378 return seconds_; | |
| 379 } | |
| 380 void Timestamp::set_seconds(::google::protobuf::int64 value) { | |
| 381 | |
| 382 seconds_ = value; | |
| 383 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds) | |
| 384 } | |
| 385 | |
| 386 // optional int32 nanos = 2; | |
| 387 void Timestamp::clear_nanos() { | |
| 388 nanos_ = 0; | |
| 389 } | |
| 390 ::google::protobuf::int32 Timestamp::nanos() const { | |
| 391 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos) | |
| 392 return nanos_; | |
| 393 } | |
| 394 void Timestamp::set_nanos(::google::protobuf::int32 value) { | |
| 395 | |
| 396 nanos_ = value; | |
| 397 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos) | |
| 398 } | |
| 399 | |
| 400 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS | |
| 401 | |
| 402 // @@protoc_insertion_point(namespace_scope) | |
| 403 | |
| 404 } // namespace protobuf | |
| 405 } // namespace google | |
| 406 | |
| 407 // @@protoc_insertion_point(global_scope) | |
| OLD | NEW |