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