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