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/any.proto |
| 3 | |
| 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
| 5 | #include <google/protobuf/any.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* Any_descriptor_ = NULL; |
| 26 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 27 | Any_reflection_ = NULL; |
| 28 | |
| 29 | } // namespace |
| 30 | |
| 31 | |
| 32 | void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() { |
| 33 | protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); |
| 34 | const ::google::protobuf::FileDescriptor* file = |
| 35 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( |
| 36 | "google/protobuf/any.proto"); |
| 37 | GOOGLE_CHECK(file != NULL); |
| 38 | Any_descriptor_ = file->message_type(0); |
| 39 | static const int Any_offsets_[2] = { |
| 40 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), |
| 41 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), |
| 42 | }; |
| 43 | Any_reflection_ = |
| 44 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 45 | Any_descriptor_, |
| 46 | Any::default_instance_, |
| 47 | Any_offsets_, |
| 48 | -1, |
| 49 | -1, |
| 50 | -1, |
| 51 | sizeof(Any), |
| 52 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), |
| 53 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _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_2fany_2eproto); |
| 62 | } |
| 63 | |
| 64 | void protobuf_RegisterTypes(const ::std::string&) { |
| 65 | protobuf_AssignDescriptorsOnce(); |
| 66 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 67 | Any_descriptor_, &Any::default_instance()); |
| 68 | } |
| 69 | |
| 70 | } // namespace |
| 71 | |
| 72 | void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() { |
| 73 | delete Any::default_instance_; |
| 74 | delete Any_reflection_; |
| 75 | } |
| 76 | |
| 77 | void protobuf_AddDesc_google_2fprotobuf_2fany_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\031google/protobuf/any.proto\022\017google.prot" |
| 85 | "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002" |
| 86 | " \001(\014BK\n\023com.google.protobufB\010AnyProtoP\001\240" |
| 87 | "\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownType" |
| 88 | "sb\006proto3", 169); |
| 89 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 90 | "google/protobuf/any.proto", &protobuf_RegisterTypes); |
| 91 | Any::default_instance_ = new Any(); |
| 92 | Any::default_instance_->InitAsDefaultInstance(); |
| 93 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto); |
| 94 | } |
| 95 | |
| 96 | // Force AddDescriptors() to be called at static initialization time. |
| 97 | struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto { |
| 98 | StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() { |
| 99 | protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); |
| 100 | } |
| 101 | } static_descriptor_initializer_google_2fprotobuf_2fany_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 | void Any::PackFrom(const ::google::protobuf::Message& message) { |
| 116 | _any_metadata_.PackFrom(message); |
| 117 | } |
| 118 | |
| 119 | bool Any::UnpackTo(::google::protobuf::Message* message) const { |
| 120 | return _any_metadata_.UnpackTo(message); |
| 121 | } |
| 122 | |
| 123 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 124 | const int Any::kTypeUrlFieldNumber; |
| 125 | const int Any::kValueFieldNumber; |
| 126 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 127 | |
| 128 | Any::Any() |
| 129 | : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { |
| 130 | SharedCtor(); |
| 131 | // @@protoc_insertion_point(constructor:google.protobuf.Any) |
| 132 | } |
| 133 | |
| 134 | void Any::InitAsDefaultInstance() { |
| 135 | _is_default_instance_ = true; |
| 136 | } |
| 137 | |
| 138 | Any::Any(const Any& from) |
| 139 | : ::google::protobuf::Message(), |
| 140 | _internal_metadata_(NULL), |
| 141 | _any_metadata_(&type_url_, &value_) { |
| 142 | SharedCtor(); |
| 143 | MergeFrom(from); |
| 144 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Any) |
| 145 | } |
| 146 | |
| 147 | void Any::SharedCtor() { |
| 148 | _is_default_instance_ = false; |
| 149 | ::google::protobuf::internal::GetEmptyString(); |
| 150 | _cached_size_ = 0; |
| 151 | type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 152 | value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 153 | } |
| 154 | |
| 155 | Any::~Any() { |
| 156 | // @@protoc_insertion_point(destructor:google.protobuf.Any) |
| 157 | SharedDtor(); |
| 158 | } |
| 159 | |
| 160 | void Any::SharedDtor() { |
| 161 | type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 162 | value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 163 | if (this != default_instance_) { |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | void Any::SetCachedSize(int size) const { |
| 168 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 169 | _cached_size_ = size; |
| 170 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 171 | } |
| 172 | const ::google::protobuf::Descriptor* Any::descriptor() { |
| 173 | protobuf_AssignDescriptorsOnce(); |
| 174 | return Any_descriptor_; |
| 175 | } |
| 176 | |
| 177 | const Any& Any::default_instance() { |
| 178 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); |
| 179 | return *default_instance_; |
| 180 | } |
| 181 | |
| 182 | Any* Any::default_instance_ = NULL; |
| 183 | |
| 184 | Any* Any::New(::google::protobuf::Arena* arena) const { |
| 185 | Any* n = new Any; |
| 186 | if (arena != NULL) { |
| 187 | arena->Own(n); |
| 188 | } |
| 189 | return n; |
| 190 | } |
| 191 | |
| 192 | void Any::Clear() { |
| 193 | type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 194 | value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 195 | } |
| 196 | |
| 197 | bool Any::MergePartialFromCodedStream( |
| 198 | ::google::protobuf::io::CodedInputStream* input) { |
| 199 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 200 | ::google::protobuf::uint32 tag; |
| 201 | // @@protoc_insertion_point(parse_start:google.protobuf.Any) |
| 202 | for (;;) { |
| 203 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 204 | tag = p.first; |
| 205 | if (!p.second) goto handle_unusual; |
| 206 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 207 | // optional string type_url = 1; |
| 208 | case 1: { |
| 209 | if (tag == 10) { |
| 210 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 211 | input, this->mutable_type_url())); |
| 212 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 213 | this->type_url().data(), this->type_url().length(), |
| 214 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 215 | "google.protobuf.Any.type_url")); |
| 216 | } else { |
| 217 | goto handle_unusual; |
| 218 | } |
| 219 | if (input->ExpectTag(18)) goto parse_value; |
| 220 | break; |
| 221 | } |
| 222 | |
| 223 | // optional bytes value = 2; |
| 224 | case 2: { |
| 225 | if (tag == 18) { |
| 226 | parse_value: |
| 227 | DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( |
| 228 | input, this->mutable_value())); |
| 229 | } else { |
| 230 | goto handle_unusual; |
| 231 | } |
| 232 | if (input->ExpectAtEnd()) goto success; |
| 233 | break; |
| 234 | } |
| 235 | |
| 236 | default: { |
| 237 | handle_unusual: |
| 238 | if (tag == 0 || |
| 239 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 240 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 241 | goto success; |
| 242 | } |
| 243 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 244 | break; |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | success: |
| 249 | // @@protoc_insertion_point(parse_success:google.protobuf.Any) |
| 250 | return true; |
| 251 | failure: |
| 252 | // @@protoc_insertion_point(parse_failure:google.protobuf.Any) |
| 253 | return false; |
| 254 | #undef DO_ |
| 255 | } |
| 256 | |
| 257 | void Any::SerializeWithCachedSizes( |
| 258 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 259 | // @@protoc_insertion_point(serialize_start:google.protobuf.Any) |
| 260 | // optional string type_url = 1; |
| 261 | if (this->type_url().size() > 0) { |
| 262 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 263 | this->type_url().data(), this->type_url().length(), |
| 264 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 265 | "google.protobuf.Any.type_url"); |
| 266 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
| 267 | 1, this->type_url(), output); |
| 268 | } |
| 269 | |
| 270 | // optional bytes value = 2; |
| 271 | if (this->value().size() > 0) { |
| 272 | ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( |
| 273 | 2, this->value(), output); |
| 274 | } |
| 275 | |
| 276 | // @@protoc_insertion_point(serialize_end:google.protobuf.Any) |
| 277 | } |
| 278 | |
| 279 | ::google::protobuf::uint8* Any::SerializeWithCachedSizesToArray( |
| 280 | ::google::protobuf::uint8* target) const { |
| 281 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) |
| 282 | // optional string type_url = 1; |
| 283 | if (this->type_url().size() > 0) { |
| 284 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 285 | this->type_url().data(), this->type_url().length(), |
| 286 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 287 | "google.protobuf.Any.type_url"); |
| 288 | target = |
| 289 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 290 | 1, this->type_url(), target); |
| 291 | } |
| 292 | |
| 293 | // optional bytes value = 2; |
| 294 | if (this->value().size() > 0) { |
| 295 | target = |
| 296 | ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( |
| 297 | 2, this->value(), target); |
| 298 | } |
| 299 | |
| 300 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any) |
| 301 | return target; |
| 302 | } |
| 303 | |
| 304 | int Any::ByteSize() const { |
| 305 | int total_size = 0; |
| 306 | |
| 307 | // optional string type_url = 1; |
| 308 | if (this->type_url().size() > 0) { |
| 309 | total_size += 1 + |
| 310 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 311 | this->type_url()); |
| 312 | } |
| 313 | |
| 314 | // optional bytes value = 2; |
| 315 | if (this->value().size() > 0) { |
| 316 | total_size += 1 + |
| 317 | ::google::protobuf::internal::WireFormatLite::BytesSize( |
| 318 | this->value()); |
| 319 | } |
| 320 | |
| 321 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 322 | _cached_size_ = total_size; |
| 323 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 324 | return total_size; |
| 325 | } |
| 326 | |
| 327 | void Any::MergeFrom(const ::google::protobuf::Message& from) { |
| 328 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 329 | const Any* source = |
| 330 | ::google::protobuf::internal::DynamicCastToGenerated<const Any>( |
| 331 | &from); |
| 332 | if (source == NULL) { |
| 333 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 334 | } else { |
| 335 | MergeFrom(*source); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | void Any::MergeFrom(const Any& from) { |
| 340 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 341 | if (from.type_url().size() > 0) { |
| 342 | |
| 343 | type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_); |
| 344 | } |
| 345 | if (from.value().size() > 0) { |
| 346 | |
| 347 | value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void Any::CopyFrom(const ::google::protobuf::Message& from) { |
| 352 | if (&from == this) return; |
| 353 | Clear(); |
| 354 | MergeFrom(from); |
| 355 | } |
| 356 | |
| 357 | void Any::CopyFrom(const Any& from) { |
| 358 | if (&from == this) return; |
| 359 | Clear(); |
| 360 | MergeFrom(from); |
| 361 | } |
| 362 | |
| 363 | bool Any::IsInitialized() const { |
| 364 | |
| 365 | return true; |
| 366 | } |
| 367 | |
| 368 | void Any::Swap(Any* other) { |
| 369 | if (other == this) return; |
| 370 | InternalSwap(other); |
| 371 | } |
| 372 | void Any::InternalSwap(Any* other) { |
| 373 | type_url_.Swap(&other->type_url_); |
| 374 | value_.Swap(&other->value_); |
| 375 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 376 | std::swap(_cached_size_, other->_cached_size_); |
| 377 | } |
| 378 | |
| 379 | ::google::protobuf::Metadata Any::GetMetadata() const { |
| 380 | protobuf_AssignDescriptorsOnce(); |
| 381 | ::google::protobuf::Metadata metadata; |
| 382 | metadata.descriptor = Any_descriptor_; |
| 383 | metadata.reflection = Any_reflection_; |
| 384 | return metadata; |
| 385 | } |
| 386 | |
| 387 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 388 | // Any |
| 389 | |
| 390 | // optional string type_url = 1; |
| 391 | void Any::clear_type_url() { |
| 392 | type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 393 | } |
| 394 | const ::std::string& Any::type_url() const { |
| 395 | // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) |
| 396 | return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 397 | } |
| 398 | void Any::set_type_url(const ::std::string& value) { |
| 399 | |
| 400 | type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); |
| 401 | // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) |
| 402 | } |
| 403 | void Any::set_type_url(const char* value) { |
| 404 | |
| 405 | type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); |
| 406 | // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) |
| 407 | } |
| 408 | void Any::set_type_url(const char* value, size_t size) { |
| 409 | |
| 410 | type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 411 | ::std::string(reinterpret_cast<const char*>(value), size)); |
| 412 | // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url) |
| 413 | } |
| 414 | ::std::string* Any::mutable_type_url() { |
| 415 | |
| 416 | // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) |
| 417 | return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 418 | } |
| 419 | ::std::string* Any::release_type_url() { |
| 420 | |
| 421 | return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 422 | } |
| 423 | void Any::set_allocated_type_url(::std::string* type_url) { |
| 424 | if (type_url != NULL) { |
| 425 | |
| 426 | } else { |
| 427 | |
| 428 | } |
| 429 | type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url); |
| 430 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) |
| 431 | } |
| 432 | |
| 433 | // optional bytes value = 2; |
| 434 | void Any::clear_value() { |
| 435 | value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 436 | } |
| 437 | const ::std::string& Any::value() const { |
| 438 | // @@protoc_insertion_point(field_get:google.protobuf.Any.value) |
| 439 | return value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 440 | } |
| 441 | void Any::set_value(const ::std::string& value) { |
| 442 | |
| 443 | value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); |
| 444 | // @@protoc_insertion_point(field_set:google.protobuf.Any.value) |
| 445 | } |
| 446 | void Any::set_value(const char* value) { |
| 447 | |
| 448 | value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); |
| 449 | // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) |
| 450 | } |
| 451 | void Any::set_value(const void* value, size_t size) { |
| 452 | |
| 453 | value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 454 | ::std::string(reinterpret_cast<const char*>(value), size)); |
| 455 | // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value) |
| 456 | } |
| 457 | ::std::string* Any::mutable_value() { |
| 458 | |
| 459 | // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) |
| 460 | return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 461 | } |
| 462 | ::std::string* Any::release_value() { |
| 463 | |
| 464 | return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 465 | } |
| 466 | void Any::set_allocated_value(::std::string* value) { |
| 467 | if (value != NULL) { |
| 468 | |
| 469 | } else { |
| 470 | |
| 471 | } |
| 472 | value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); |
| 473 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) |
| 474 | } |
| 475 | |
| 476 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 477 | |
| 478 | // @@protoc_insertion_point(namespace_scope) |
| 479 | |
| 480 | } // namespace protobuf |
| 481 | } // namespace google |
| 482 | |
| 483 | // @@protoc_insertion_point(global_scope) |