Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/struct.proto |
| 3 | |
| 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 5 | #include <google/protobuf/struct.pb.h> |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 6 | |
| 7 | #include <algorithm> |
| 8 | |
| 9 | #include <google/protobuf/stubs/common.h> |
Feng Xiao | e841bac | 2015-12-11 17:09:20 -0800 | [diff] [blame] | 10 | #include <google/protobuf/stubs/port.h> |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 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* Struct_descriptor_ = NULL; |
| 26 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 27 | Struct_reflection_ = NULL; |
| 28 | const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor_ = NULL; |
| 29 | const ::google::protobuf::Descriptor* Value_descriptor_ = NULL; |
| 30 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 31 | Value_reflection_ = NULL; |
| 32 | struct ValueOneofInstance { |
| 33 | int null_value_; |
| 34 | double number_value_; |
| 35 | ::google::protobuf::internal::ArenaStringPtr string_value_; |
| 36 | bool bool_value_; |
| 37 | const ::google::protobuf::Struct* struct_value_; |
| 38 | const ::google::protobuf::ListValue* list_value_; |
| 39 | }* Value_default_oneof_instance_ = NULL; |
| 40 | const ::google::protobuf::Descriptor* ListValue_descriptor_ = NULL; |
| 41 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 42 | ListValue_reflection_ = NULL; |
| 43 | const ::google::protobuf::EnumDescriptor* NullValue_descriptor_ = NULL; |
| 44 | |
| 45 | } // namespace |
| 46 | |
| 47 | |
| 48 | void protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto() { |
| 49 | protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 50 | const ::google::protobuf::FileDescriptor* file = |
| 51 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( |
| 52 | "google/protobuf/struct.proto"); |
| 53 | GOOGLE_CHECK(file != NULL); |
| 54 | Struct_descriptor_ = file->message_type(0); |
| 55 | static const int Struct_offsets_[1] = { |
| 56 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_), |
| 57 | }; |
| 58 | Struct_reflection_ = |
| 59 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 60 | Struct_descriptor_, |
| 61 | Struct::default_instance_, |
| 62 | Struct_offsets_, |
| 63 | -1, |
| 64 | -1, |
| 65 | -1, |
| 66 | sizeof(Struct), |
| 67 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_), |
| 68 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _is_default_instance_)); |
| 69 | Struct_FieldsEntry_descriptor_ = Struct_descriptor_->nested_type(0); |
| 70 | Value_descriptor_ = file->message_type(1); |
| 71 | static const int Value_offsets_[7] = { |
| 72 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, null_value_), |
| 73 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, number_value_), |
| 74 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, string_value_), |
| 75 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, bool_value_), |
| 76 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, struct_value_), |
| 77 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, list_value_), |
| 78 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_), |
| 79 | }; |
| 80 | Value_reflection_ = |
| 81 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 82 | Value_descriptor_, |
| 83 | Value::default_instance_, |
| 84 | Value_offsets_, |
| 85 | -1, |
| 86 | -1, |
| 87 | -1, |
| 88 | Value_default_oneof_instance_, |
| 89 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]), |
| 90 | sizeof(Value), |
| 91 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_), |
| 92 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _is_default_instance_)); |
| 93 | ListValue_descriptor_ = file->message_type(2); |
| 94 | static const int ListValue_offsets_[1] = { |
| 95 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_), |
| 96 | }; |
| 97 | ListValue_reflection_ = |
| 98 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 99 | ListValue_descriptor_, |
| 100 | ListValue::default_instance_, |
| 101 | ListValue_offsets_, |
| 102 | -1, |
| 103 | -1, |
| 104 | -1, |
| 105 | sizeof(ListValue), |
| 106 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_), |
| 107 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _is_default_instance_)); |
| 108 | NullValue_descriptor_ = file->enum_type(0); |
| 109 | } |
| 110 | |
| 111 | namespace { |
| 112 | |
| 113 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); |
| 114 | inline void protobuf_AssignDescriptorsOnce() { |
| 115 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, |
| 116 | &protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto); |
| 117 | } |
| 118 | |
| 119 | void protobuf_RegisterTypes(const ::std::string&) { |
| 120 | protobuf_AssignDescriptorsOnce(); |
| 121 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 122 | Struct_descriptor_, &Struct::default_instance()); |
| 123 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 124 | Struct_FieldsEntry_descriptor_, |
| 125 | ::google::protobuf::internal::MapEntry< |
| 126 | ::std::string, |
| 127 | ::google::protobuf::Value, |
| 128 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, |
| 129 | ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, |
| 130 | 0>::CreateDefaultInstance( |
| 131 | Struct_FieldsEntry_descriptor_)); |
| 132 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 133 | Value_descriptor_, &Value::default_instance()); |
| 134 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 135 | ListValue_descriptor_, &ListValue::default_instance()); |
| 136 | } |
| 137 | |
| 138 | } // namespace |
| 139 | |
| 140 | void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto() { |
| 141 | delete Struct::default_instance_; |
| 142 | delete Struct_reflection_; |
| 143 | delete Value::default_instance_; |
| 144 | delete Value_default_oneof_instance_; |
| 145 | delete Value_reflection_; |
| 146 | delete ListValue::default_instance_; |
| 147 | delete ListValue_reflection_; |
| 148 | } |
| 149 | |
| 150 | void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto() { |
| 151 | static bool already_here = false; |
| 152 | if (already_here) return; |
| 153 | already_here = true; |
| 154 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
| 155 | |
| 156 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
| 157 | "\n\034google/protobuf/struct.proto\022\017google.p" |
| 158 | "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo" |
| 159 | "gle.protobuf.Struct.FieldsEntry\032E\n\013Field" |
| 160 | "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo" |
| 161 | "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull" |
| 162 | "_value\030\001 \001(\0162\032.google.protobuf.NullValue" |
| 163 | "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val" |
| 164 | "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru" |
| 165 | "ct_value\030\005 \001(\0132\027.google.protobuf.StructH" |
| 166 | "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf." |
| 167 | "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu" |
| 168 | "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull" |
Jisi Liu | 3b3c8ab | 2016-03-30 11:39:59 -0700 | [diff] [blame] | 169 | "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro" |
| 170 | "tobufB\013StructProtoP\001Z1github.com/golang/" |
| 171 | "protobuf/ptypes/struct;structpb\240\001\001\242\002\003GPB" |
| 172 | "\252\002\036Google.Protobuf.WellKnownTypesb\006proto" |
| 173 | "3", 641); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 174 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 175 | "google/protobuf/struct.proto", &protobuf_RegisterTypes); |
| 176 | Struct::default_instance_ = new Struct(); |
| 177 | Value::default_instance_ = new Value(); |
| 178 | Value_default_oneof_instance_ = new ValueOneofInstance(); |
| 179 | ListValue::default_instance_ = new ListValue(); |
| 180 | Struct::default_instance_->InitAsDefaultInstance(); |
| 181 | Value::default_instance_->InitAsDefaultInstance(); |
| 182 | ListValue::default_instance_->InitAsDefaultInstance(); |
| 183 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto); |
| 184 | } |
| 185 | |
| 186 | // Force AddDescriptors() to be called at static initialization time. |
| 187 | struct StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto { |
| 188 | StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto() { |
| 189 | protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 190 | } |
| 191 | } static_descriptor_initializer_google_2fprotobuf_2fstruct_2eproto_; |
| 192 | const ::google::protobuf::EnumDescriptor* NullValue_descriptor() { |
| 193 | protobuf_AssignDescriptorsOnce(); |
| 194 | return NullValue_descriptor_; |
| 195 | } |
| 196 | bool NullValue_IsValid(int value) { |
| 197 | switch(value) { |
| 198 | case 0: |
| 199 | return true; |
| 200 | default: |
| 201 | return false; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | |
| 206 | namespace { |
| 207 | |
| 208 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; |
| 209 | static void MergeFromFail(int line) { |
| 210 | GOOGLE_CHECK(false) << __FILE__ << ":" << line; |
| 211 | } |
| 212 | |
| 213 | } // namespace |
| 214 | |
| 215 | |
| 216 | // =================================================================== |
| 217 | |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 218 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 219 | const int Struct::kFieldsFieldNumber; |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 220 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 221 | |
| 222 | Struct::Struct() |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 223 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 224 | SharedCtor(); |
| 225 | // @@protoc_insertion_point(constructor:google.protobuf.Struct) |
| 226 | } |
| 227 | |
| 228 | void Struct::InitAsDefaultInstance() { |
| 229 | _is_default_instance_ = true; |
| 230 | } |
| 231 | |
| 232 | Struct::Struct(const Struct& from) |
| 233 | : ::google::protobuf::Message(), |
| 234 | _internal_metadata_(NULL) { |
| 235 | SharedCtor(); |
| 236 | MergeFrom(from); |
| 237 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct) |
| 238 | } |
| 239 | |
| 240 | void Struct::SharedCtor() { |
| 241 | _is_default_instance_ = false; |
| 242 | _cached_size_ = 0; |
| 243 | fields_.SetAssignDescriptorCallback( |
| 244 | protobuf_AssignDescriptorsOnce); |
| 245 | fields_.SetEntryDescriptor( |
| 246 | &::google::protobuf::Struct_FieldsEntry_descriptor_); |
| 247 | } |
| 248 | |
| 249 | Struct::~Struct() { |
| 250 | // @@protoc_insertion_point(destructor:google.protobuf.Struct) |
| 251 | SharedDtor(); |
| 252 | } |
| 253 | |
| 254 | void Struct::SharedDtor() { |
| 255 | if (this != default_instance_) { |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | void Struct::SetCachedSize(int size) const { |
| 260 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 261 | _cached_size_ = size; |
| 262 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 263 | } |
| 264 | const ::google::protobuf::Descriptor* Struct::descriptor() { |
| 265 | protobuf_AssignDescriptorsOnce(); |
| 266 | return Struct_descriptor_; |
| 267 | } |
| 268 | |
| 269 | const Struct& Struct::default_instance() { |
| 270 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 271 | return *default_instance_; |
| 272 | } |
| 273 | |
| 274 | Struct* Struct::default_instance_ = NULL; |
| 275 | |
| 276 | Struct* Struct::New(::google::protobuf::Arena* arena) const { |
| 277 | Struct* n = new Struct; |
| 278 | if (arena != NULL) { |
| 279 | arena->Own(n); |
| 280 | } |
| 281 | return n; |
| 282 | } |
| 283 | |
| 284 | void Struct::Clear() { |
| 285 | fields_.Clear(); |
| 286 | } |
| 287 | |
| 288 | bool Struct::MergePartialFromCodedStream( |
| 289 | ::google::protobuf::io::CodedInputStream* input) { |
| 290 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 291 | ::google::protobuf::uint32 tag; |
| 292 | // @@protoc_insertion_point(parse_start:google.protobuf.Struct) |
| 293 | for (;;) { |
| 294 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 295 | tag = p.first; |
| 296 | if (!p.second) goto handle_unusual; |
| 297 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 298 | // map<string, .google.protobuf.Value> fields = 1; |
| 299 | case 1: { |
| 300 | if (tag == 10) { |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 301 | DO_(input->IncrementRecursionDepth()); |
| 302 | parse_loop_fields: |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 303 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry(fields_.NewEntry()); |
| 304 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 305 | input, entry.get())); |
| 306 | (*mutable_fields())[entry->key()].Swap(entry->mutable_value()); |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 307 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 308 | entry->key().data(), entry->key().length(), |
| 309 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 310 | "google.protobuf.Struct.FieldsEntry.key")); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 311 | } else { |
| 312 | goto handle_unusual; |
| 313 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 314 | if (input->ExpectTag(10)) goto parse_loop_fields; |
| 315 | input->UnsafeDecrementRecursionDepth(); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 316 | if (input->ExpectAtEnd()) goto success; |
| 317 | break; |
| 318 | } |
| 319 | |
| 320 | default: { |
| 321 | handle_unusual: |
| 322 | if (tag == 0 || |
| 323 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 324 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 325 | goto success; |
| 326 | } |
| 327 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 328 | break; |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | success: |
| 333 | // @@protoc_insertion_point(parse_success:google.protobuf.Struct) |
| 334 | return true; |
| 335 | failure: |
| 336 | // @@protoc_insertion_point(parse_failure:google.protobuf.Struct) |
| 337 | return false; |
| 338 | #undef DO_ |
| 339 | } |
| 340 | |
| 341 | void Struct::SerializeWithCachedSizes( |
| 342 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 343 | // @@protoc_insertion_point(serialize_start:google.protobuf.Struct) |
| 344 | // map<string, .google.protobuf.Value> fields = 1; |
| 345 | { |
| 346 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 347 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 348 | it = this->fields().begin(); |
| 349 | it != this->fields().end(); ++it) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 350 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 351 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 352 | 1, *entry, output); |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 353 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 354 | it->first.data(), it->first.length(), |
| 355 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 356 | "google.protobuf.Struct.FieldsEntry.key"); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 357 | } |
| 358 | } |
| 359 | |
| 360 | // @@protoc_insertion_point(serialize_end:google.protobuf.Struct) |
| 361 | } |
| 362 | |
| 363 | ::google::protobuf::uint8* Struct::SerializeWithCachedSizesToArray( |
| 364 | ::google::protobuf::uint8* target) const { |
| 365 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) |
| 366 | // map<string, .google.protobuf.Value> fields = 1; |
| 367 | { |
| 368 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 369 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 370 | it = this->fields().begin(); |
| 371 | it != this->fields().end(); ++it) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 372 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 373 | target = ::google::protobuf::internal::WireFormatLite:: |
| 374 | WriteMessageNoVirtualToArray( |
| 375 | 1, *entry, target); |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 376 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 377 | it->first.data(), it->first.length(), |
| 378 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 379 | "google.protobuf.Struct.FieldsEntry.key"); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 380 | } |
| 381 | } |
| 382 | |
| 383 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct) |
| 384 | return target; |
| 385 | } |
| 386 | |
| 387 | int Struct::ByteSize() const { |
| 388 | int total_size = 0; |
| 389 | |
| 390 | // map<string, .google.protobuf.Value> fields = 1; |
| 391 | total_size += 1 * this->fields_size(); |
| 392 | { |
| 393 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 394 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 395 | it = this->fields().begin(); |
| 396 | it != this->fields().end(); ++it) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 397 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 398 | total_size += ::google::protobuf::internal::WireFormatLite:: |
| 399 | MessageSizeNoVirtual(*entry); |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 404 | _cached_size_ = total_size; |
| 405 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 406 | return total_size; |
| 407 | } |
| 408 | |
| 409 | void Struct::MergeFrom(const ::google::protobuf::Message& from) { |
| 410 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 411 | const Struct* source = |
| 412 | ::google::protobuf::internal::DynamicCastToGenerated<const Struct>( |
| 413 | &from); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 414 | if (source == NULL) { |
| 415 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 416 | } else { |
| 417 | MergeFrom(*source); |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | void Struct::MergeFrom(const Struct& from) { |
| 422 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 423 | fields_.MergeFrom(from.fields_); |
| 424 | } |
| 425 | |
| 426 | void Struct::CopyFrom(const ::google::protobuf::Message& from) { |
| 427 | if (&from == this) return; |
| 428 | Clear(); |
| 429 | MergeFrom(from); |
| 430 | } |
| 431 | |
| 432 | void Struct::CopyFrom(const Struct& from) { |
| 433 | if (&from == this) return; |
| 434 | Clear(); |
| 435 | MergeFrom(from); |
| 436 | } |
| 437 | |
| 438 | bool Struct::IsInitialized() const { |
| 439 | |
| 440 | return true; |
| 441 | } |
| 442 | |
| 443 | void Struct::Swap(Struct* other) { |
| 444 | if (other == this) return; |
| 445 | InternalSwap(other); |
| 446 | } |
| 447 | void Struct::InternalSwap(Struct* other) { |
| 448 | fields_.Swap(&other->fields_); |
| 449 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 450 | std::swap(_cached_size_, other->_cached_size_); |
| 451 | } |
| 452 | |
| 453 | ::google::protobuf::Metadata Struct::GetMetadata() const { |
| 454 | protobuf_AssignDescriptorsOnce(); |
| 455 | ::google::protobuf::Metadata metadata; |
| 456 | metadata.descriptor = Struct_descriptor_; |
| 457 | metadata.reflection = Struct_reflection_; |
| 458 | return metadata; |
| 459 | } |
| 460 | |
| 461 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 462 | // Struct |
| 463 | |
| 464 | // map<string, .google.protobuf.Value> fields = 1; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 465 | int Struct::fields_size() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 466 | return fields_.size(); |
| 467 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 468 | void Struct::clear_fields() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 469 | fields_.Clear(); |
| 470 | } |
| 471 | const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >& |
| 472 | Struct::fields() const { |
| 473 | // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields) |
| 474 | return fields_.GetMap(); |
| 475 | } |
| 476 | ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >* |
| 477 | Struct::mutable_fields() { |
| 478 | // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields) |
| 479 | return fields_.MutableMap(); |
| 480 | } |
| 481 | |
| 482 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 483 | |
| 484 | // =================================================================== |
| 485 | |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 486 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 487 | const int Value::kNullValueFieldNumber; |
| 488 | const int Value::kNumberValueFieldNumber; |
| 489 | const int Value::kStringValueFieldNumber; |
| 490 | const int Value::kBoolValueFieldNumber; |
| 491 | const int Value::kStructValueFieldNumber; |
| 492 | const int Value::kListValueFieldNumber; |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 493 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 494 | |
| 495 | Value::Value() |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 496 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 497 | SharedCtor(); |
| 498 | // @@protoc_insertion_point(constructor:google.protobuf.Value) |
| 499 | } |
| 500 | |
| 501 | void Value::InitAsDefaultInstance() { |
| 502 | _is_default_instance_ = true; |
| 503 | Value_default_oneof_instance_->null_value_ = 0; |
| 504 | Value_default_oneof_instance_->number_value_ = 0; |
| 505 | Value_default_oneof_instance_->string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 506 | Value_default_oneof_instance_->bool_value_ = false; |
| 507 | Value_default_oneof_instance_->struct_value_ = const_cast< ::google::protobuf::Struct*>(&::google::protobuf::Struct::default_instance()); |
| 508 | Value_default_oneof_instance_->list_value_ = const_cast< ::google::protobuf::ListValue*>(&::google::protobuf::ListValue::default_instance()); |
| 509 | } |
| 510 | |
| 511 | Value::Value(const Value& from) |
| 512 | : ::google::protobuf::Message(), |
| 513 | _internal_metadata_(NULL) { |
| 514 | SharedCtor(); |
| 515 | MergeFrom(from); |
| 516 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Value) |
| 517 | } |
| 518 | |
| 519 | void Value::SharedCtor() { |
| 520 | _is_default_instance_ = false; |
| 521 | ::google::protobuf::internal::GetEmptyString(); |
| 522 | _cached_size_ = 0; |
| 523 | clear_has_kind(); |
| 524 | } |
| 525 | |
| 526 | Value::~Value() { |
| 527 | // @@protoc_insertion_point(destructor:google.protobuf.Value) |
| 528 | SharedDtor(); |
| 529 | } |
| 530 | |
| 531 | void Value::SharedDtor() { |
| 532 | if (has_kind()) { |
| 533 | clear_kind(); |
| 534 | } |
| 535 | if (this != default_instance_) { |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | void Value::SetCachedSize(int size) const { |
| 540 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 541 | _cached_size_ = size; |
| 542 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 543 | } |
| 544 | const ::google::protobuf::Descriptor* Value::descriptor() { |
| 545 | protobuf_AssignDescriptorsOnce(); |
| 546 | return Value_descriptor_; |
| 547 | } |
| 548 | |
| 549 | const Value& Value::default_instance() { |
| 550 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 551 | return *default_instance_; |
| 552 | } |
| 553 | |
| 554 | Value* Value::default_instance_ = NULL; |
| 555 | |
| 556 | Value* Value::New(::google::protobuf::Arena* arena) const { |
| 557 | Value* n = new Value; |
| 558 | if (arena != NULL) { |
| 559 | arena->Own(n); |
| 560 | } |
| 561 | return n; |
| 562 | } |
| 563 | |
| 564 | void Value::clear_kind() { |
| 565 | switch(kind_case()) { |
| 566 | case kNullValue: { |
| 567 | // No need to clear |
| 568 | break; |
| 569 | } |
| 570 | case kNumberValue: { |
| 571 | // No need to clear |
| 572 | break; |
| 573 | } |
| 574 | case kStringValue: { |
| 575 | kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 576 | break; |
| 577 | } |
| 578 | case kBoolValue: { |
| 579 | // No need to clear |
| 580 | break; |
| 581 | } |
| 582 | case kStructValue: { |
| 583 | delete kind_.struct_value_; |
| 584 | break; |
| 585 | } |
| 586 | case kListValue: { |
| 587 | delete kind_.list_value_; |
| 588 | break; |
| 589 | } |
| 590 | case KIND_NOT_SET: { |
| 591 | break; |
| 592 | } |
| 593 | } |
| 594 | _oneof_case_[0] = KIND_NOT_SET; |
| 595 | } |
| 596 | |
| 597 | |
| 598 | void Value::Clear() { |
| 599 | clear_kind(); |
| 600 | } |
| 601 | |
| 602 | bool Value::MergePartialFromCodedStream( |
| 603 | ::google::protobuf::io::CodedInputStream* input) { |
| 604 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 605 | ::google::protobuf::uint32 tag; |
| 606 | // @@protoc_insertion_point(parse_start:google.protobuf.Value) |
| 607 | for (;;) { |
| 608 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 609 | tag = p.first; |
| 610 | if (!p.second) goto handle_unusual; |
| 611 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 612 | // optional .google.protobuf.NullValue null_value = 1; |
| 613 | case 1: { |
| 614 | if (tag == 8) { |
| 615 | int value; |
| 616 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 617 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 618 | input, &value))); |
| 619 | set_null_value(static_cast< ::google::protobuf::NullValue >(value)); |
| 620 | } else { |
| 621 | goto handle_unusual; |
| 622 | } |
| 623 | if (input->ExpectTag(17)) goto parse_number_value; |
| 624 | break; |
| 625 | } |
| 626 | |
| 627 | // optional double number_value = 2; |
| 628 | case 2: { |
| 629 | if (tag == 17) { |
| 630 | parse_number_value: |
| 631 | clear_kind(); |
| 632 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 633 | double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( |
| 634 | input, &kind_.number_value_))); |
| 635 | set_has_number_value(); |
| 636 | } else { |
| 637 | goto handle_unusual; |
| 638 | } |
| 639 | if (input->ExpectTag(26)) goto parse_string_value; |
| 640 | break; |
| 641 | } |
| 642 | |
| 643 | // optional string string_value = 3; |
| 644 | case 3: { |
| 645 | if (tag == 26) { |
| 646 | parse_string_value: |
| 647 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 648 | input, this->mutable_string_value())); |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 649 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 650 | this->string_value().data(), this->string_value().length(), |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 651 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 652 | "google.protobuf.Value.string_value")); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 653 | } else { |
| 654 | goto handle_unusual; |
| 655 | } |
| 656 | if (input->ExpectTag(32)) goto parse_bool_value; |
| 657 | break; |
| 658 | } |
| 659 | |
| 660 | // optional bool bool_value = 4; |
| 661 | case 4: { |
| 662 | if (tag == 32) { |
| 663 | parse_bool_value: |
| 664 | clear_kind(); |
| 665 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 666 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 667 | input, &kind_.bool_value_))); |
| 668 | set_has_bool_value(); |
| 669 | } else { |
| 670 | goto handle_unusual; |
| 671 | } |
| 672 | if (input->ExpectTag(42)) goto parse_struct_value; |
| 673 | break; |
| 674 | } |
| 675 | |
| 676 | // optional .google.protobuf.Struct struct_value = 5; |
| 677 | case 5: { |
| 678 | if (tag == 42) { |
| 679 | parse_struct_value: |
| 680 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 681 | input, mutable_struct_value())); |
| 682 | } else { |
| 683 | goto handle_unusual; |
| 684 | } |
| 685 | if (input->ExpectTag(50)) goto parse_list_value; |
| 686 | break; |
| 687 | } |
| 688 | |
| 689 | // optional .google.protobuf.ListValue list_value = 6; |
| 690 | case 6: { |
| 691 | if (tag == 50) { |
| 692 | parse_list_value: |
| 693 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 694 | input, mutable_list_value())); |
| 695 | } else { |
| 696 | goto handle_unusual; |
| 697 | } |
| 698 | if (input->ExpectAtEnd()) goto success; |
| 699 | break; |
| 700 | } |
| 701 | |
| 702 | default: { |
| 703 | handle_unusual: |
| 704 | if (tag == 0 || |
| 705 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 706 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 707 | goto success; |
| 708 | } |
| 709 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 710 | break; |
| 711 | } |
| 712 | } |
| 713 | } |
| 714 | success: |
| 715 | // @@protoc_insertion_point(parse_success:google.protobuf.Value) |
| 716 | return true; |
| 717 | failure: |
| 718 | // @@protoc_insertion_point(parse_failure:google.protobuf.Value) |
| 719 | return false; |
| 720 | #undef DO_ |
| 721 | } |
| 722 | |
| 723 | void Value::SerializeWithCachedSizes( |
| 724 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 725 | // @@protoc_insertion_point(serialize_start:google.protobuf.Value) |
| 726 | // optional .google.protobuf.NullValue null_value = 1; |
| 727 | if (has_null_value()) { |
| 728 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 729 | 1, this->null_value(), output); |
| 730 | } |
| 731 | |
| 732 | // optional double number_value = 2; |
| 733 | if (has_number_value()) { |
| 734 | ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output); |
| 735 | } |
| 736 | |
| 737 | // optional string string_value = 3; |
| 738 | if (has_string_value()) { |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 739 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 740 | this->string_value().data(), this->string_value().length(), |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 741 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 742 | "google.protobuf.Value.string_value"); |
| 743 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
| 744 | 3, this->string_value(), output); |
| 745 | } |
| 746 | |
| 747 | // optional bool bool_value = 4; |
| 748 | if (has_bool_value()) { |
| 749 | ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output); |
| 750 | } |
| 751 | |
| 752 | // optional .google.protobuf.Struct struct_value = 5; |
| 753 | if (has_struct_value()) { |
| 754 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 755 | 5, *kind_.struct_value_, output); |
| 756 | } |
| 757 | |
| 758 | // optional .google.protobuf.ListValue list_value = 6; |
| 759 | if (has_list_value()) { |
| 760 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 761 | 6, *kind_.list_value_, output); |
| 762 | } |
| 763 | |
| 764 | // @@protoc_insertion_point(serialize_end:google.protobuf.Value) |
| 765 | } |
| 766 | |
| 767 | ::google::protobuf::uint8* Value::SerializeWithCachedSizesToArray( |
| 768 | ::google::protobuf::uint8* target) const { |
| 769 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) |
| 770 | // optional .google.protobuf.NullValue null_value = 1; |
| 771 | if (has_null_value()) { |
| 772 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 773 | 1, this->null_value(), target); |
| 774 | } |
| 775 | |
| 776 | // optional double number_value = 2; |
| 777 | if (has_number_value()) { |
| 778 | target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target); |
| 779 | } |
| 780 | |
| 781 | // optional string string_value = 3; |
| 782 | if (has_string_value()) { |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 783 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 784 | this->string_value().data(), this->string_value().length(), |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 785 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 786 | "google.protobuf.Value.string_value"); |
| 787 | target = |
| 788 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 789 | 3, this->string_value(), target); |
| 790 | } |
| 791 | |
| 792 | // optional bool bool_value = 4; |
| 793 | if (has_bool_value()) { |
| 794 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target); |
| 795 | } |
| 796 | |
| 797 | // optional .google.protobuf.Struct struct_value = 5; |
| 798 | if (has_struct_value()) { |
| 799 | target = ::google::protobuf::internal::WireFormatLite:: |
| 800 | WriteMessageNoVirtualToArray( |
| 801 | 5, *kind_.struct_value_, target); |
| 802 | } |
| 803 | |
| 804 | // optional .google.protobuf.ListValue list_value = 6; |
| 805 | if (has_list_value()) { |
| 806 | target = ::google::protobuf::internal::WireFormatLite:: |
| 807 | WriteMessageNoVirtualToArray( |
| 808 | 6, *kind_.list_value_, target); |
| 809 | } |
| 810 | |
| 811 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value) |
| 812 | return target; |
| 813 | } |
| 814 | |
| 815 | int Value::ByteSize() const { |
| 816 | int total_size = 0; |
| 817 | |
| 818 | switch (kind_case()) { |
| 819 | // optional .google.protobuf.NullValue null_value = 1; |
| 820 | case kNullValue: { |
| 821 | total_size += 1 + |
| 822 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value()); |
| 823 | break; |
| 824 | } |
| 825 | // optional double number_value = 2; |
| 826 | case kNumberValue: { |
| 827 | total_size += 1 + 8; |
| 828 | break; |
| 829 | } |
| 830 | // optional string string_value = 3; |
| 831 | case kStringValue: { |
| 832 | total_size += 1 + |
| 833 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 834 | this->string_value()); |
| 835 | break; |
| 836 | } |
| 837 | // optional bool bool_value = 4; |
| 838 | case kBoolValue: { |
| 839 | total_size += 1 + 1; |
| 840 | break; |
| 841 | } |
| 842 | // optional .google.protobuf.Struct struct_value = 5; |
| 843 | case kStructValue: { |
| 844 | total_size += 1 + |
| 845 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 846 | *kind_.struct_value_); |
| 847 | break; |
| 848 | } |
| 849 | // optional .google.protobuf.ListValue list_value = 6; |
| 850 | case kListValue: { |
| 851 | total_size += 1 + |
| 852 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 853 | *kind_.list_value_); |
| 854 | break; |
| 855 | } |
| 856 | case KIND_NOT_SET: { |
| 857 | break; |
| 858 | } |
| 859 | } |
| 860 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 861 | _cached_size_ = total_size; |
| 862 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 863 | return total_size; |
| 864 | } |
| 865 | |
| 866 | void Value::MergeFrom(const ::google::protobuf::Message& from) { |
| 867 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 868 | const Value* source = |
| 869 | ::google::protobuf::internal::DynamicCastToGenerated<const Value>( |
| 870 | &from); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 871 | if (source == NULL) { |
| 872 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 873 | } else { |
| 874 | MergeFrom(*source); |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | void Value::MergeFrom(const Value& from) { |
| 879 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 880 | switch (from.kind_case()) { |
| 881 | case kNullValue: { |
| 882 | set_null_value(from.null_value()); |
| 883 | break; |
| 884 | } |
| 885 | case kNumberValue: { |
| 886 | set_number_value(from.number_value()); |
| 887 | break; |
| 888 | } |
| 889 | case kStringValue: { |
| 890 | set_string_value(from.string_value()); |
| 891 | break; |
| 892 | } |
| 893 | case kBoolValue: { |
| 894 | set_bool_value(from.bool_value()); |
| 895 | break; |
| 896 | } |
| 897 | case kStructValue: { |
| 898 | mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value()); |
| 899 | break; |
| 900 | } |
| 901 | case kListValue: { |
| 902 | mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value()); |
| 903 | break; |
| 904 | } |
| 905 | case KIND_NOT_SET: { |
| 906 | break; |
| 907 | } |
| 908 | } |
| 909 | } |
| 910 | |
| 911 | void Value::CopyFrom(const ::google::protobuf::Message& from) { |
| 912 | if (&from == this) return; |
| 913 | Clear(); |
| 914 | MergeFrom(from); |
| 915 | } |
| 916 | |
| 917 | void Value::CopyFrom(const Value& from) { |
| 918 | if (&from == this) return; |
| 919 | Clear(); |
| 920 | MergeFrom(from); |
| 921 | } |
| 922 | |
| 923 | bool Value::IsInitialized() const { |
| 924 | |
| 925 | return true; |
| 926 | } |
| 927 | |
| 928 | void Value::Swap(Value* other) { |
| 929 | if (other == this) return; |
| 930 | InternalSwap(other); |
| 931 | } |
| 932 | void Value::InternalSwap(Value* other) { |
| 933 | std::swap(kind_, other->kind_); |
| 934 | std::swap(_oneof_case_[0], other->_oneof_case_[0]); |
| 935 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 936 | std::swap(_cached_size_, other->_cached_size_); |
| 937 | } |
| 938 | |
| 939 | ::google::protobuf::Metadata Value::GetMetadata() const { |
| 940 | protobuf_AssignDescriptorsOnce(); |
| 941 | ::google::protobuf::Metadata metadata; |
| 942 | metadata.descriptor = Value_descriptor_; |
| 943 | metadata.reflection = Value_reflection_; |
| 944 | return metadata; |
| 945 | } |
| 946 | |
| 947 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 948 | // Value |
| 949 | |
| 950 | // optional .google.protobuf.NullValue null_value = 1; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 951 | bool Value::has_null_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 952 | return kind_case() == kNullValue; |
| 953 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 954 | void Value::set_has_null_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 955 | _oneof_case_[0] = kNullValue; |
| 956 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 957 | void Value::clear_null_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 958 | if (has_null_value()) { |
| 959 | kind_.null_value_ = 0; |
| 960 | clear_has_kind(); |
| 961 | } |
| 962 | } |
| 963 | ::google::protobuf::NullValue Value::null_value() const { |
| 964 | // @@protoc_insertion_point(field_get:google.protobuf.Value.null_value) |
| 965 | if (has_null_value()) { |
| 966 | return static_cast< ::google::protobuf::NullValue >(kind_.null_value_); |
| 967 | } |
| 968 | return static_cast< ::google::protobuf::NullValue >(0); |
| 969 | } |
| 970 | void Value::set_null_value(::google::protobuf::NullValue value) { |
| 971 | if (!has_null_value()) { |
| 972 | clear_kind(); |
| 973 | set_has_null_value(); |
| 974 | } |
| 975 | kind_.null_value_ = value; |
| 976 | // @@protoc_insertion_point(field_set:google.protobuf.Value.null_value) |
| 977 | } |
| 978 | |
| 979 | // optional double number_value = 2; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 980 | bool Value::has_number_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 981 | return kind_case() == kNumberValue; |
| 982 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 983 | void Value::set_has_number_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 984 | _oneof_case_[0] = kNumberValue; |
| 985 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 986 | void Value::clear_number_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 987 | if (has_number_value()) { |
| 988 | kind_.number_value_ = 0; |
| 989 | clear_has_kind(); |
| 990 | } |
| 991 | } |
| 992 | double Value::number_value() const { |
| 993 | // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value) |
| 994 | if (has_number_value()) { |
| 995 | return kind_.number_value_; |
| 996 | } |
| 997 | return 0; |
| 998 | } |
| 999 | void Value::set_number_value(double value) { |
| 1000 | if (!has_number_value()) { |
| 1001 | clear_kind(); |
| 1002 | set_has_number_value(); |
| 1003 | } |
| 1004 | kind_.number_value_ = value; |
| 1005 | // @@protoc_insertion_point(field_set:google.protobuf.Value.number_value) |
| 1006 | } |
| 1007 | |
| 1008 | // optional string string_value = 3; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1009 | bool Value::has_string_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1010 | return kind_case() == kStringValue; |
| 1011 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1012 | void Value::set_has_string_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1013 | _oneof_case_[0] = kStringValue; |
| 1014 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1015 | void Value::clear_string_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1016 | if (has_string_value()) { |
| 1017 | kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1018 | clear_has_kind(); |
| 1019 | } |
| 1020 | } |
| 1021 | const ::std::string& Value::string_value() const { |
| 1022 | // @@protoc_insertion_point(field_get:google.protobuf.Value.string_value) |
| 1023 | if (has_string_value()) { |
| 1024 | return kind_.string_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1025 | } |
| 1026 | return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); |
| 1027 | } |
| 1028 | void Value::set_string_value(const ::std::string& value) { |
| 1029 | // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) |
| 1030 | if (!has_string_value()) { |
| 1031 | clear_kind(); |
| 1032 | set_has_string_value(); |
| 1033 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1034 | } |
| 1035 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); |
| 1036 | // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) |
| 1037 | } |
| 1038 | void Value::set_string_value(const char* value) { |
| 1039 | if (!has_string_value()) { |
| 1040 | clear_kind(); |
| 1041 | set_has_string_value(); |
| 1042 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1043 | } |
| 1044 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 1045 | ::std::string(value)); |
| 1046 | // @@protoc_insertion_point(field_set_char:google.protobuf.Value.string_value) |
| 1047 | } |
| 1048 | void Value::set_string_value(const char* value, size_t size) { |
| 1049 | if (!has_string_value()) { |
| 1050 | clear_kind(); |
| 1051 | set_has_string_value(); |
| 1052 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1053 | } |
| 1054 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( |
| 1055 | reinterpret_cast<const char*>(value), size)); |
| 1056 | // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value) |
| 1057 | } |
| 1058 | ::std::string* Value::mutable_string_value() { |
| 1059 | if (!has_string_value()) { |
| 1060 | clear_kind(); |
| 1061 | set_has_string_value(); |
| 1062 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1063 | } |
| 1064 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.string_value) |
| 1065 | return kind_.string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1066 | } |
| 1067 | ::std::string* Value::release_string_value() { |
| 1068 | if (has_string_value()) { |
| 1069 | clear_has_kind(); |
| 1070 | return kind_.string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1071 | } else { |
| 1072 | return NULL; |
| 1073 | } |
| 1074 | } |
| 1075 | void Value::set_allocated_string_value(::std::string* string_value) { |
| 1076 | if (!has_string_value()) { |
| 1077 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1078 | } |
| 1079 | clear_kind(); |
| 1080 | if (string_value != NULL) { |
| 1081 | set_has_string_value(); |
| 1082 | kind_.string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 1083 | string_value); |
| 1084 | } |
| 1085 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value) |
| 1086 | } |
| 1087 | |
| 1088 | // optional bool bool_value = 4; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1089 | bool Value::has_bool_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1090 | return kind_case() == kBoolValue; |
| 1091 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1092 | void Value::set_has_bool_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1093 | _oneof_case_[0] = kBoolValue; |
| 1094 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1095 | void Value::clear_bool_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1096 | if (has_bool_value()) { |
| 1097 | kind_.bool_value_ = false; |
| 1098 | clear_has_kind(); |
| 1099 | } |
| 1100 | } |
| 1101 | bool Value::bool_value() const { |
| 1102 | // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value) |
| 1103 | if (has_bool_value()) { |
| 1104 | return kind_.bool_value_; |
| 1105 | } |
| 1106 | return false; |
| 1107 | } |
| 1108 | void Value::set_bool_value(bool value) { |
| 1109 | if (!has_bool_value()) { |
| 1110 | clear_kind(); |
| 1111 | set_has_bool_value(); |
| 1112 | } |
| 1113 | kind_.bool_value_ = value; |
| 1114 | // @@protoc_insertion_point(field_set:google.protobuf.Value.bool_value) |
| 1115 | } |
| 1116 | |
| 1117 | // optional .google.protobuf.Struct struct_value = 5; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1118 | bool Value::has_struct_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1119 | return kind_case() == kStructValue; |
| 1120 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1121 | void Value::set_has_struct_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1122 | _oneof_case_[0] = kStructValue; |
| 1123 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1124 | void Value::clear_struct_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1125 | if (has_struct_value()) { |
| 1126 | delete kind_.struct_value_; |
| 1127 | clear_has_kind(); |
| 1128 | } |
| 1129 | } |
| 1130 | const ::google::protobuf::Struct& Value::struct_value() const { |
| 1131 | // @@protoc_insertion_point(field_get:google.protobuf.Value.struct_value) |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1132 | return has_struct_value() |
| 1133 | ? *kind_.struct_value_ |
| 1134 | : ::google::protobuf::Struct::default_instance(); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1135 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1136 | ::google::protobuf::Struct* Value::mutable_struct_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1137 | if (!has_struct_value()) { |
| 1138 | clear_kind(); |
| 1139 | set_has_struct_value(); |
| 1140 | kind_.struct_value_ = new ::google::protobuf::Struct; |
| 1141 | } |
| 1142 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.struct_value) |
| 1143 | return kind_.struct_value_; |
| 1144 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1145 | ::google::protobuf::Struct* Value::release_struct_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1146 | if (has_struct_value()) { |
| 1147 | clear_has_kind(); |
| 1148 | ::google::protobuf::Struct* temp = kind_.struct_value_; |
| 1149 | kind_.struct_value_ = NULL; |
| 1150 | return temp; |
| 1151 | } else { |
| 1152 | return NULL; |
| 1153 | } |
| 1154 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1155 | void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1156 | clear_kind(); |
| 1157 | if (struct_value) { |
| 1158 | set_has_struct_value(); |
| 1159 | kind_.struct_value_ = struct_value; |
| 1160 | } |
| 1161 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value) |
| 1162 | } |
| 1163 | |
| 1164 | // optional .google.protobuf.ListValue list_value = 6; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1165 | bool Value::has_list_value() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1166 | return kind_case() == kListValue; |
| 1167 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1168 | void Value::set_has_list_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1169 | _oneof_case_[0] = kListValue; |
| 1170 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1171 | void Value::clear_list_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1172 | if (has_list_value()) { |
| 1173 | delete kind_.list_value_; |
| 1174 | clear_has_kind(); |
| 1175 | } |
| 1176 | } |
| 1177 | const ::google::protobuf::ListValue& Value::list_value() const { |
| 1178 | // @@protoc_insertion_point(field_get:google.protobuf.Value.list_value) |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1179 | return has_list_value() |
| 1180 | ? *kind_.list_value_ |
| 1181 | : ::google::protobuf::ListValue::default_instance(); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1182 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1183 | ::google::protobuf::ListValue* Value::mutable_list_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1184 | if (!has_list_value()) { |
| 1185 | clear_kind(); |
| 1186 | set_has_list_value(); |
| 1187 | kind_.list_value_ = new ::google::protobuf::ListValue; |
| 1188 | } |
| 1189 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.list_value) |
| 1190 | return kind_.list_value_; |
| 1191 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1192 | ::google::protobuf::ListValue* Value::release_list_value() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1193 | if (has_list_value()) { |
| 1194 | clear_has_kind(); |
| 1195 | ::google::protobuf::ListValue* temp = kind_.list_value_; |
| 1196 | kind_.list_value_ = NULL; |
| 1197 | return temp; |
| 1198 | } else { |
| 1199 | return NULL; |
| 1200 | } |
| 1201 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1202 | void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1203 | clear_kind(); |
| 1204 | if (list_value) { |
| 1205 | set_has_list_value(); |
| 1206 | kind_.list_value_ = list_value; |
| 1207 | } |
| 1208 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value) |
| 1209 | } |
| 1210 | |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1211 | bool Value::has_kind() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1212 | return kind_case() != KIND_NOT_SET; |
| 1213 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1214 | void Value::clear_has_kind() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1215 | _oneof_case_[0] = KIND_NOT_SET; |
| 1216 | } |
| 1217 | Value::KindCase Value::kind_case() const { |
| 1218 | return Value::KindCase(_oneof_case_[0]); |
| 1219 | } |
| 1220 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1221 | |
| 1222 | // =================================================================== |
| 1223 | |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 1224 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1225 | const int ListValue::kValuesFieldNumber; |
Bo Yang | 1f0286a | 2015-12-04 13:18:44 -0800 | [diff] [blame] | 1226 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1227 | |
| 1228 | ListValue::ListValue() |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1229 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1230 | SharedCtor(); |
| 1231 | // @@protoc_insertion_point(constructor:google.protobuf.ListValue) |
| 1232 | } |
| 1233 | |
| 1234 | void ListValue::InitAsDefaultInstance() { |
| 1235 | _is_default_instance_ = true; |
| 1236 | } |
| 1237 | |
| 1238 | ListValue::ListValue(const ListValue& from) |
| 1239 | : ::google::protobuf::Message(), |
| 1240 | _internal_metadata_(NULL) { |
| 1241 | SharedCtor(); |
| 1242 | MergeFrom(from); |
| 1243 | // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue) |
| 1244 | } |
| 1245 | |
| 1246 | void ListValue::SharedCtor() { |
| 1247 | _is_default_instance_ = false; |
| 1248 | _cached_size_ = 0; |
| 1249 | } |
| 1250 | |
| 1251 | ListValue::~ListValue() { |
| 1252 | // @@protoc_insertion_point(destructor:google.protobuf.ListValue) |
| 1253 | SharedDtor(); |
| 1254 | } |
| 1255 | |
| 1256 | void ListValue::SharedDtor() { |
| 1257 | if (this != default_instance_) { |
| 1258 | } |
| 1259 | } |
| 1260 | |
| 1261 | void ListValue::SetCachedSize(int size) const { |
| 1262 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1263 | _cached_size_ = size; |
| 1264 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1265 | } |
| 1266 | const ::google::protobuf::Descriptor* ListValue::descriptor() { |
| 1267 | protobuf_AssignDescriptorsOnce(); |
| 1268 | return ListValue_descriptor_; |
| 1269 | } |
| 1270 | |
| 1271 | const ListValue& ListValue::default_instance() { |
| 1272 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 1273 | return *default_instance_; |
| 1274 | } |
| 1275 | |
| 1276 | ListValue* ListValue::default_instance_ = NULL; |
| 1277 | |
| 1278 | ListValue* ListValue::New(::google::protobuf::Arena* arena) const { |
| 1279 | ListValue* n = new ListValue; |
| 1280 | if (arena != NULL) { |
| 1281 | arena->Own(n); |
| 1282 | } |
| 1283 | return n; |
| 1284 | } |
| 1285 | |
| 1286 | void ListValue::Clear() { |
| 1287 | values_.Clear(); |
| 1288 | } |
| 1289 | |
| 1290 | bool ListValue::MergePartialFromCodedStream( |
| 1291 | ::google::protobuf::io::CodedInputStream* input) { |
| 1292 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 1293 | ::google::protobuf::uint32 tag; |
| 1294 | // @@protoc_insertion_point(parse_start:google.protobuf.ListValue) |
| 1295 | for (;;) { |
| 1296 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 1297 | tag = p.first; |
| 1298 | if (!p.second) goto handle_unusual; |
| 1299 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 1300 | // repeated .google.protobuf.Value values = 1; |
| 1301 | case 1: { |
| 1302 | if (tag == 10) { |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1303 | DO_(input->IncrementRecursionDepth()); |
| 1304 | parse_loop_values: |
| 1305 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1306 | input, add_values())); |
| 1307 | } else { |
| 1308 | goto handle_unusual; |
| 1309 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1310 | if (input->ExpectTag(10)) goto parse_loop_values; |
| 1311 | input->UnsafeDecrementRecursionDepth(); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1312 | if (input->ExpectAtEnd()) goto success; |
| 1313 | break; |
| 1314 | } |
| 1315 | |
| 1316 | default: { |
| 1317 | handle_unusual: |
| 1318 | if (tag == 0 || |
| 1319 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1320 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1321 | goto success; |
| 1322 | } |
| 1323 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 1324 | break; |
| 1325 | } |
| 1326 | } |
| 1327 | } |
| 1328 | success: |
| 1329 | // @@protoc_insertion_point(parse_success:google.protobuf.ListValue) |
| 1330 | return true; |
| 1331 | failure: |
| 1332 | // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue) |
| 1333 | return false; |
| 1334 | #undef DO_ |
| 1335 | } |
| 1336 | |
| 1337 | void ListValue::SerializeWithCachedSizes( |
| 1338 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 1339 | // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue) |
| 1340 | // repeated .google.protobuf.Value values = 1; |
| 1341 | for (unsigned int i = 0, n = this->values_size(); i < n; i++) { |
| 1342 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 1343 | 1, this->values(i), output); |
| 1344 | } |
| 1345 | |
| 1346 | // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue) |
| 1347 | } |
| 1348 | |
| 1349 | ::google::protobuf::uint8* ListValue::SerializeWithCachedSizesToArray( |
| 1350 | ::google::protobuf::uint8* target) const { |
| 1351 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) |
| 1352 | // repeated .google.protobuf.Value values = 1; |
| 1353 | for (unsigned int i = 0, n = this->values_size(); i < n; i++) { |
| 1354 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1355 | WriteMessageNoVirtualToArray( |
| 1356 | 1, this->values(i), target); |
| 1357 | } |
| 1358 | |
| 1359 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue) |
| 1360 | return target; |
| 1361 | } |
| 1362 | |
| 1363 | int ListValue::ByteSize() const { |
| 1364 | int total_size = 0; |
| 1365 | |
| 1366 | // repeated .google.protobuf.Value values = 1; |
| 1367 | total_size += 1 * this->values_size(); |
| 1368 | for (int i = 0; i < this->values_size(); i++) { |
| 1369 | total_size += |
| 1370 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 1371 | this->values(i)); |
| 1372 | } |
| 1373 | |
| 1374 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1375 | _cached_size_ = total_size; |
| 1376 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1377 | return total_size; |
| 1378 | } |
| 1379 | |
| 1380 | void ListValue::MergeFrom(const ::google::protobuf::Message& from) { |
| 1381 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1382 | const ListValue* source = |
| 1383 | ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>( |
| 1384 | &from); |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1385 | if (source == NULL) { |
| 1386 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 1387 | } else { |
| 1388 | MergeFrom(*source); |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | void ListValue::MergeFrom(const ListValue& from) { |
| 1393 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 1394 | values_.MergeFrom(from.values_); |
| 1395 | } |
| 1396 | |
| 1397 | void ListValue::CopyFrom(const ::google::protobuf::Message& from) { |
| 1398 | if (&from == this) return; |
| 1399 | Clear(); |
| 1400 | MergeFrom(from); |
| 1401 | } |
| 1402 | |
| 1403 | void ListValue::CopyFrom(const ListValue& from) { |
| 1404 | if (&from == this) return; |
| 1405 | Clear(); |
| 1406 | MergeFrom(from); |
| 1407 | } |
| 1408 | |
| 1409 | bool ListValue::IsInitialized() const { |
| 1410 | |
| 1411 | return true; |
| 1412 | } |
| 1413 | |
| 1414 | void ListValue::Swap(ListValue* other) { |
| 1415 | if (other == this) return; |
| 1416 | InternalSwap(other); |
| 1417 | } |
| 1418 | void ListValue::InternalSwap(ListValue* other) { |
| 1419 | values_.UnsafeArenaSwap(&other->values_); |
| 1420 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 1421 | std::swap(_cached_size_, other->_cached_size_); |
| 1422 | } |
| 1423 | |
| 1424 | ::google::protobuf::Metadata ListValue::GetMetadata() const { |
| 1425 | protobuf_AssignDescriptorsOnce(); |
| 1426 | ::google::protobuf::Metadata metadata; |
| 1427 | metadata.descriptor = ListValue_descriptor_; |
| 1428 | metadata.reflection = ListValue_reflection_; |
| 1429 | return metadata; |
| 1430 | } |
| 1431 | |
| 1432 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1433 | // ListValue |
| 1434 | |
| 1435 | // repeated .google.protobuf.Value values = 1; |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1436 | int ListValue::values_size() const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1437 | return values_.size(); |
| 1438 | } |
Bo Yang | 5db2173 | 2015-05-21 14:28:59 -0700 | [diff] [blame] | 1439 | void ListValue::clear_values() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1440 | values_.Clear(); |
| 1441 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1442 | const ::google::protobuf::Value& ListValue::values(int index) const { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1443 | // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values) |
| 1444 | return values_.Get(index); |
| 1445 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1446 | ::google::protobuf::Value* ListValue::mutable_values(int index) { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1447 | // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values) |
| 1448 | return values_.Mutable(index); |
| 1449 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1450 | ::google::protobuf::Value* ListValue::add_values() { |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1451 | // @@protoc_insertion_point(field_add:google.protobuf.ListValue.values) |
| 1452 | return values_.Add(); |
| 1453 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1454 | ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >* |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1455 | ListValue::mutable_values() { |
| 1456 | // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values) |
| 1457 | return &values_; |
| 1458 | } |
Jisi Liu | 4c663d8 | 2015-08-25 17:03:05 -0700 | [diff] [blame] | 1459 | const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >& |
| 1460 | ListValue::values() const { |
| 1461 | // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values) |
| 1462 | return values_; |
| 1463 | } |
Feng Xiao | 33c9280 | 2015-05-11 13:47:41 -0700 | [diff] [blame] | 1464 | |
| 1465 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1466 | |
| 1467 | // @@protoc_insertion_point(namespace_scope) |
| 1468 | |
| 1469 | } // namespace protobuf |
| 1470 | } // namespace google |
| 1471 | |
| 1472 | // @@protoc_insertion_point(global_scope) |