OLD | NEW |
1 // Generated by the protocol buffer compiler. DO NOT EDIT! | 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 // source: google/protobuf/any.proto | 2 // source: google/protobuf/any.proto |
3 | 3 |
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION | 4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
5 #include <google/protobuf/any.pb.h> | 5 #include <google/protobuf/any.pb.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include <google/protobuf/stubs/common.h> | 9 #include <google/protobuf/stubs/common.h> |
10 #include <google/protobuf/stubs/port.h> | 10 #include <google/protobuf/stubs/port.h> |
11 #include <google/protobuf/stubs/once.h> | 11 #include <google/protobuf/stubs/once.h> |
12 #include <google/protobuf/io/coded_stream.h> | 12 #include <google/protobuf/io/coded_stream.h> |
13 #include <google/protobuf/wire_format_lite_inl.h> | 13 #include <google/protobuf/wire_format_lite_inl.h> |
14 #include <google/protobuf/descriptor.h> | 14 #include <google/protobuf/descriptor.h> |
15 #include <google/protobuf/generated_message_reflection.h> | 15 #include <google/protobuf/generated_message_reflection.h> |
16 #include <google/protobuf/reflection_ops.h> | 16 #include <google/protobuf/reflection_ops.h> |
17 #include <google/protobuf/wire_format.h> | 17 #include <google/protobuf/wire_format.h> |
18 // @@protoc_insertion_point(includes) | 18 // @@protoc_insertion_point(includes) |
19 | 19 |
20 namespace google { | 20 namespace google { |
21 namespace protobuf { | 21 namespace protobuf { |
| 22 class AnyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyCo
nstructed<Any> {}; |
| 23 AnyDefaultTypeInternal _Any_default_instance_; |
22 | 24 |
23 namespace { | 25 namespace { |
24 | 26 |
25 const ::google::protobuf::Descriptor* Any_descriptor_ = NULL; | 27 ::google::protobuf::Metadata file_level_metadata[1]; |
26 const ::google::protobuf::internal::GeneratedMessageReflection* | |
27 Any_reflection_ = NULL; | |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 | 31 |
32 void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() { | 32 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fany_2epro
to() GOOGLE_ATTRIBUTE_COLD; |
33 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); | 33 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fany_2epro
to() { |
34 const ::google::protobuf::FileDescriptor* file = | 34 static const ::google::protobuf::uint32 offsets[] = { |
35 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( | 35 ~0u, // no _has_bits_ |
36 "google/protobuf/any.proto"); | 36 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), |
37 GOOGLE_CHECK(file != NULL); | 37 ~0u, // no _extensions_ |
38 Any_descriptor_ = file->message_type(0); | 38 ~0u, // no _oneof_case_ |
39 static const int Any_offsets_[2] = { | |
40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), | 39 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), |
41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), | 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), |
42 }; | 41 }; |
43 Any_reflection_ = | 42 return offsets; |
44 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessag
eReflection( | |
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 } | 43 } |
55 | 44 |
| 45 static const ::google::protobuf::internal::MigrationSchema schemas[] = { |
| 46 { 0, -1, sizeof(Any)}, |
| 47 }; |
| 48 |
| 49 static const ::google::protobuf::internal::DefaultInstanceData file_default_inst
ances[] = { |
| 50 {reinterpret_cast<const ::google::protobuf::Message*>(&_Any_default_instance_)
, NULL}, |
| 51 }; |
| 52 |
56 namespace { | 53 namespace { |
57 | 54 |
58 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); | 55 void protobuf_AssignDescriptors() { |
59 inline void protobuf_AssignDescriptorsOnce() { | 56 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); |
60 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, | 57 ::google::protobuf::MessageFactory* factory = NULL; |
61 &protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto); | 58 AssignDescriptors( |
| 59 "google/protobuf/any.proto", schemas, file_default_instances, protobuf_Off
sets_google_2fprotobuf_2fany_2eproto(), factory, |
| 60 file_level_metadata, NULL, NULL); |
62 } | 61 } |
63 | 62 |
| 63 void protobuf_AssignDescriptorsOnce() { |
| 64 static GOOGLE_PROTOBUF_DECLARE_ONCE(once); |
| 65 ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); |
| 66 } |
| 67 |
| 68 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; |
64 void protobuf_RegisterTypes(const ::std::string&) { | 69 void protobuf_RegisterTypes(const ::std::string&) { |
65 protobuf_AssignDescriptorsOnce(); | 70 protobuf_AssignDescriptorsOnce(); |
66 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( | 71 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); |
67 Any_descriptor_, &Any::default_instance()); | |
68 } | 72 } |
69 | 73 |
70 } // namespace | 74 } // namespace |
71 | 75 |
72 void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() { | 76 void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() { |
73 delete Any::default_instance_; | 77 _Any_default_instance_.Shutdown(); |
74 delete Any_reflection_; | 78 delete file_level_metadata[0].reflection; |
75 } | 79 } |
76 | 80 |
77 void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() { | 81 void protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto_impl() { |
78 static bool already_here = false; | |
79 if (already_here) return; | |
80 already_here = true; | |
81 GOOGLE_PROTOBUF_VERIFY_VERSION; | 82 GOOGLE_PROTOBUF_VERIFY_VERSION; |
82 | 83 |
| 84 ::google::protobuf::internal::InitProtobufDefaults(); |
| 85 _Any_default_instance_.DefaultConstruct(); |
| 86 } |
| 87 |
| 88 void protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto() { |
| 89 static GOOGLE_PROTOBUF_DECLARE_ONCE(once); |
| 90 ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprot
obuf_2fany_2eproto_impl); |
| 91 } |
| 92 void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl() { |
| 93 protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); |
| 94 static const char descriptor[] = { |
| 95 "\n\031google/protobuf/any.proto\022\017google.prot" |
| 96 "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\0
30\002" |
| 97 " \001(\014Bo\n\023com.google.protobufB\010AnyProtoP\001Z" |
| 98 "%github.com/golang/protobuf/ptypes/any\242\002" |
| 99 "\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p" |
| 100 "roto3" |
| 101 }; |
83 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( | 102 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
84 "\n\031google/protobuf/any.proto\022\017google.prot" | 103 descriptor, 205); |
85 "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030
\002" | |
86 " \001(\014Br\n\023com.google.protobufB\010AnyProtoP\001Z" | |
87 "%github.com/golang/protobuf/ptypes/any\240\001" | |
88 "\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypes" | |
89 "b\006proto3", 208); | |
90 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( | 104 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
91 "google/protobuf/any.proto", &protobuf_RegisterTypes); | 105 "google/protobuf/any.proto", &protobuf_RegisterTypes); |
92 Any::default_instance_ = new Any(); | |
93 Any::default_instance_->InitAsDefaultInstance(); | |
94 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2fany_2eproto); | 106 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2fany_2eproto); |
95 } | 107 } |
96 | 108 |
| 109 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_on
ce_); |
| 110 void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() { |
| 111 ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fany_2
eproto_once_, |
| 112 &protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl); |
| 113 } |
97 // Force AddDescriptors() to be called at static initialization time. | 114 // Force AddDescriptors() to be called at static initialization time. |
98 struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto { | 115 struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto { |
99 StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() { | 116 StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() { |
100 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); | 117 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); |
101 } | 118 } |
102 } static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_; | 119 } static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_; |
103 | 120 |
104 namespace { | |
105 | |
106 static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; | |
107 static void MergeFromFail(int line) { | |
108 GOOGLE_CHECK(false) << __FILE__ << ":" << line; | |
109 } | |
110 | |
111 } // namespace | |
112 | |
113 | |
114 // =================================================================== | 121 // =================================================================== |
115 | 122 |
116 void Any::PackFrom(const ::google::protobuf::Message& message) { | 123 void Any::PackFrom(const ::google::protobuf::Message& message) { |
117 _any_metadata_.PackFrom(message); | 124 _any_metadata_.PackFrom(message); |
118 } | 125 } |
119 | 126 |
120 void Any::PackFrom(const ::google::protobuf::Message& message, | 127 void Any::PackFrom(const ::google::protobuf::Message& message, |
121 const ::std::string& type_url_prefix) { | 128 const ::std::string& type_url_prefix) { |
122 _any_metadata_.PackFrom(message, type_url_prefix); | 129 _any_metadata_.PackFrom(message, type_url_prefix); |
123 } | 130 } |
124 | 131 |
125 bool Any::UnpackTo(::google::protobuf::Message* message) const { | 132 bool Any::UnpackTo(::google::protobuf::Message* message) const { |
126 return _any_metadata_.UnpackTo(message); | 133 return _any_metadata_.UnpackTo(message); |
127 } | 134 } |
128 | 135 |
129 #if !defined(_MSC_VER) || _MSC_VER >= 1900 | 136 #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
130 const int Any::kTypeUrlFieldNumber; | 137 const int Any::kTypeUrlFieldNumber; |
131 const int Any::kValueFieldNumber; | 138 const int Any::kValueFieldNumber; |
132 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 | 139 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
133 | 140 |
134 Any::Any() | 141 Any::Any() |
135 : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&ty
pe_url_, &value_) { | 142 : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&ty
pe_url_, &value_) { |
| 143 if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { |
| 144 protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); |
| 145 } |
136 SharedCtor(); | 146 SharedCtor(); |
137 // @@protoc_insertion_point(constructor:google.protobuf.Any) | 147 // @@protoc_insertion_point(constructor:google.protobuf.Any) |
138 } | 148 } |
139 | |
140 void Any::InitAsDefaultInstance() { | |
141 _is_default_instance_ = true; | |
142 } | |
143 | |
144 Any::Any(const Any& from) | 149 Any::Any(const Any& from) |
145 : ::google::protobuf::Message(), | 150 : ::google::protobuf::Message(), |
146 _internal_metadata_(NULL), | 151 _internal_metadata_(NULL), |
147 _any_metadata_(&type_url_, &value_) { | 152 _cached_size_(0), |
148 SharedCtor(); | 153 _any_metadata_(&type_url_, &value_) { |
149 MergeFrom(from); | 154 _internal_metadata_.MergeFrom(from._internal_metadata_); |
| 155 type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); |
| 156 if (from.type_url().size() > 0) { |
| 157 type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited(), from.type_url_); |
| 158 } |
| 159 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyIn
ited()); |
| 160 if (from.value().size() > 0) { |
| 161 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited(), from.value_); |
| 162 } |
150 // @@protoc_insertion_point(copy_constructor:google.protobuf.Any) | 163 // @@protoc_insertion_point(copy_constructor:google.protobuf.Any) |
151 } | 164 } |
152 | 165 |
153 void Any::SharedCtor() { | 166 void Any::SharedCtor() { |
154 _is_default_instance_ = false; | |
155 ::google::protobuf::internal::GetEmptyString(); | |
156 _cached_size_ = 0; | |
157 type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); | 167 type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); |
158 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyIn
ited()); | 168 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyIn
ited()); |
| 169 _cached_size_ = 0; |
159 } | 170 } |
160 | 171 |
161 Any::~Any() { | 172 Any::~Any() { |
162 // @@protoc_insertion_point(destructor:google.protobuf.Any) | 173 // @@protoc_insertion_point(destructor:google.protobuf.Any) |
163 SharedDtor(); | 174 SharedDtor(); |
164 } | 175 } |
165 | 176 |
166 void Any::SharedDtor() { | 177 void Any::SharedDtor() { |
167 type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyI
nited()); | 178 type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyI
nited()); |
168 value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInit
ed()); | 179 value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInit
ed()); |
169 if (this != default_instance_) { | |
170 } | |
171 } | 180 } |
172 | 181 |
173 void Any::SetCachedSize(int size) const { | 182 void Any::SetCachedSize(int size) const { |
174 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 183 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
175 _cached_size_ = size; | 184 _cached_size_ = size; |
176 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 185 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
177 } | 186 } |
178 const ::google::protobuf::Descriptor* Any::descriptor() { | 187 const ::google::protobuf::Descriptor* Any::descriptor() { |
179 protobuf_AssignDescriptorsOnce(); | 188 protobuf_AssignDescriptorsOnce(); |
180 return Any_descriptor_; | 189 return file_level_metadata[0].descriptor; |
181 } | 190 } |
182 | 191 |
183 const Any& Any::default_instance() { | 192 const Any& Any::default_instance() { |
184 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fany_2eprot
o(); | 193 protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); |
185 return *default_instance_; | 194 return *internal_default_instance(); |
186 } | 195 } |
187 | 196 |
188 Any* Any::default_instance_ = NULL; | |
189 | |
190 Any* Any::New(::google::protobuf::Arena* arena) const { | 197 Any* Any::New(::google::protobuf::Arena* arena) const { |
191 Any* n = new Any; | 198 Any* n = new Any; |
192 if (arena != NULL) { | 199 if (arena != NULL) { |
193 arena->Own(n); | 200 arena->Own(n); |
194 } | 201 } |
195 return n; | 202 return n; |
196 } | 203 } |
197 | 204 |
198 void Any::Clear() { | 205 void Any::Clear() { |
199 // @@protoc_insertion_point(message_clear_start:google.protobuf.Any) | 206 // @@protoc_insertion_point(message_clear_start:google.protobuf.Any) |
200 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited()); | 207 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited()); |
201 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); | 208 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); |
202 } | 209 } |
203 | 210 |
204 bool Any::MergePartialFromCodedStream( | 211 bool Any::MergePartialFromCodedStream( |
205 ::google::protobuf::io::CodedInputStream* input) { | 212 ::google::protobuf::io::CodedInputStream* input) { |
206 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure | 213 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
207 ::google::protobuf::uint32 tag; | 214 ::google::protobuf::uint32 tag; |
208 // @@protoc_insertion_point(parse_start:google.protobuf.Any) | 215 // @@protoc_insertion_point(parse_start:google.protobuf.Any) |
209 for (;;) { | 216 for (;;) { |
210 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(
127); | 217 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffN
oLastTag(127u); |
211 tag = p.first; | 218 tag = p.first; |
212 if (!p.second) goto handle_unusual; | 219 if (!p.second) goto handle_unusual; |
213 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { | 220 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { |
214 // optional string type_url = 1; | 221 // string type_url = 1; |
215 case 1: { | 222 case 1: { |
216 if (tag == 10) { | 223 if (tag == 10u) { |
217 DO_(::google::protobuf::internal::WireFormatLite::ReadString( | 224 DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
218 input, this->mutable_type_url())); | 225 input, this->mutable_type_url())); |
219 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( | 226 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
220 this->type_url().data(), this->type_url().length(), | 227 this->type_url().data(), this->type_url().length(), |
221 ::google::protobuf::internal::WireFormatLite::PARSE, | 228 ::google::protobuf::internal::WireFormatLite::PARSE, |
222 "google.protobuf.Any.type_url")); | 229 "google.protobuf.Any.type_url")); |
223 } else { | 230 } else { |
224 goto handle_unusual; | 231 goto handle_unusual; |
225 } | 232 } |
226 if (input->ExpectTag(18)) goto parse_value; | |
227 break; | 233 break; |
228 } | 234 } |
229 | 235 |
230 // optional bytes value = 2; | 236 // bytes value = 2; |
231 case 2: { | 237 case 2: { |
232 if (tag == 18) { | 238 if (tag == 18u) { |
233 parse_value: | |
234 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( | 239 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( |
235 input, this->mutable_value())); | 240 input, this->mutable_value())); |
236 } else { | 241 } else { |
237 goto handle_unusual; | 242 goto handle_unusual; |
238 } | 243 } |
239 if (input->ExpectAtEnd()) goto success; | |
240 break; | 244 break; |
241 } | 245 } |
242 | 246 |
243 default: { | 247 default: { |
244 handle_unusual: | 248 handle_unusual: |
245 if (tag == 0 || | 249 if (tag == 0 || |
246 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == | 250 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
247 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { | 251 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
248 goto success; | 252 goto success; |
249 } | 253 } |
250 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; | 254 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; |
251 break; | 255 break; |
252 } | 256 } |
253 } | 257 } |
254 } | 258 } |
255 success: | 259 success: |
256 // @@protoc_insertion_point(parse_success:google.protobuf.Any) | 260 // @@protoc_insertion_point(parse_success:google.protobuf.Any) |
257 return true; | 261 return true; |
258 failure: | 262 failure: |
259 // @@protoc_insertion_point(parse_failure:google.protobuf.Any) | 263 // @@protoc_insertion_point(parse_failure:google.protobuf.Any) |
260 return false; | 264 return false; |
261 #undef DO_ | 265 #undef DO_ |
262 } | 266 } |
263 | 267 |
264 void Any::SerializeWithCachedSizes( | 268 void Any::SerializeWithCachedSizes( |
265 ::google::protobuf::io::CodedOutputStream* output) const { | 269 ::google::protobuf::io::CodedOutputStream* output) const { |
266 // @@protoc_insertion_point(serialize_start:google.protobuf.Any) | 270 // @@protoc_insertion_point(serialize_start:google.protobuf.Any) |
267 // optional string type_url = 1; | 271 // string type_url = 1; |
268 if (this->type_url().size() > 0) { | 272 if (this->type_url().size() > 0) { |
269 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( | 273 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
270 this->type_url().data(), this->type_url().length(), | 274 this->type_url().data(), this->type_url().length(), |
271 ::google::protobuf::internal::WireFormatLite::SERIALIZE, | 275 ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
272 "google.protobuf.Any.type_url"); | 276 "google.protobuf.Any.type_url"); |
273 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( | 277 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
274 1, this->type_url(), output); | 278 1, this->type_url(), output); |
275 } | 279 } |
276 | 280 |
277 // optional bytes value = 2; | 281 // bytes value = 2; |
278 if (this->value().size() > 0) { | 282 if (this->value().size() > 0) { |
279 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( | 283 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( |
280 2, this->value(), output); | 284 2, this->value(), output); |
281 } | 285 } |
282 | 286 |
283 // @@protoc_insertion_point(serialize_end:google.protobuf.Any) | 287 // @@protoc_insertion_point(serialize_end:google.protobuf.Any) |
284 } | 288 } |
285 | 289 |
286 ::google::protobuf::uint8* Any::SerializeWithCachedSizesToArray( | 290 ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray( |
287 ::google::protobuf::uint8* target) const { | 291 bool deterministic, ::google::protobuf::uint8* target) const { |
| 292 (void)deterministic; // Unused |
288 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) | 293 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) |
289 // optional string type_url = 1; | 294 // string type_url = 1; |
290 if (this->type_url().size() > 0) { | 295 if (this->type_url().size() > 0) { |
291 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( | 296 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
292 this->type_url().data(), this->type_url().length(), | 297 this->type_url().data(), this->type_url().length(), |
293 ::google::protobuf::internal::WireFormatLite::SERIALIZE, | 298 ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
294 "google.protobuf.Any.type_url"); | 299 "google.protobuf.Any.type_url"); |
295 target = | 300 target = |
296 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( | 301 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
297 1, this->type_url(), target); | 302 1, this->type_url(), target); |
298 } | 303 } |
299 | 304 |
300 // optional bytes value = 2; | 305 // bytes value = 2; |
301 if (this->value().size() > 0) { | 306 if (this->value().size() > 0) { |
302 target = | 307 target = |
303 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( | 308 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( |
304 2, this->value(), target); | 309 2, this->value(), target); |
305 } | 310 } |
306 | 311 |
307 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any) | 312 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any) |
308 return target; | 313 return target; |
309 } | 314 } |
310 | 315 |
311 int Any::ByteSize() const { | 316 size_t Any::ByteSizeLong() const { |
312 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any) | 317 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any) |
313 int total_size = 0; | 318 size_t total_size = 0; |
314 | 319 |
315 // optional string type_url = 1; | 320 // string type_url = 1; |
316 if (this->type_url().size() > 0) { | 321 if (this->type_url().size() > 0) { |
317 total_size += 1 + | 322 total_size += 1 + |
318 ::google::protobuf::internal::WireFormatLite::StringSize( | 323 ::google::protobuf::internal::WireFormatLite::StringSize( |
319 this->type_url()); | 324 this->type_url()); |
320 } | 325 } |
321 | 326 |
322 // optional bytes value = 2; | 327 // bytes value = 2; |
323 if (this->value().size() > 0) { | 328 if (this->value().size() > 0) { |
324 total_size += 1 + | 329 total_size += 1 + |
325 ::google::protobuf::internal::WireFormatLite::BytesSize( | 330 ::google::protobuf::internal::WireFormatLite::BytesSize( |
326 this->value()); | 331 this->value()); |
327 } | 332 } |
328 | 333 |
| 334 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
329 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 335 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
330 _cached_size_ = total_size; | 336 _cached_size_ = cached_size; |
331 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 337 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
332 return total_size; | 338 return total_size; |
333 } | 339 } |
334 | 340 |
335 void Any::MergeFrom(const ::google::protobuf::Message& from) { | 341 void Any::MergeFrom(const ::google::protobuf::Message& from) { |
336 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any) | 342 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any) |
337 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); | 343 GOOGLE_DCHECK_NE(&from, this); |
338 const Any* source = | 344 const Any* source = |
339 ::google::protobuf::internal::DynamicCastToGenerated<const Any>( | 345 ::google::protobuf::internal::DynamicCastToGenerated<const Any>( |
340 &from); | 346 &from); |
341 if (source == NULL) { | 347 if (source == NULL) { |
342 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.A
ny) | 348 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.A
ny) |
343 ::google::protobuf::internal::ReflectionOps::Merge(from, this); | 349 ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
344 } else { | 350 } else { |
345 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Any) | 351 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Any) |
346 MergeFrom(*source); | 352 MergeFrom(*source); |
347 } | 353 } |
348 } | 354 } |
349 | 355 |
350 void Any::MergeFrom(const Any& from) { | 356 void Any::MergeFrom(const Any& from) { |
351 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any) | 357 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any) |
352 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); | 358 GOOGLE_DCHECK_NE(&from, this); |
| 359 _internal_metadata_.MergeFrom(from._internal_metadata_); |
353 if (from.type_url().size() > 0) { | 360 if (from.type_url().size() > 0) { |
354 | 361 |
355 type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited(), from.type_url_); | 362 type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited(), from.type_url_); |
356 } | 363 } |
357 if (from.value().size() > 0) { | 364 if (from.value().size() > 0) { |
358 | 365 |
359 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited(), from.value_); | 366 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlread
yInited(), from.value_); |
360 } | 367 } |
361 } | 368 } |
362 | 369 |
363 void Any::CopyFrom(const ::google::protobuf::Message& from) { | 370 void Any::CopyFrom(const ::google::protobuf::Message& from) { |
364 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any) | 371 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any) |
365 if (&from == this) return; | 372 if (&from == this) return; |
366 Clear(); | 373 Clear(); |
367 MergeFrom(from); | 374 MergeFrom(from); |
368 } | 375 } |
369 | 376 |
370 void Any::CopyFrom(const Any& from) { | 377 void Any::CopyFrom(const Any& from) { |
371 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any) | 378 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any) |
372 if (&from == this) return; | 379 if (&from == this) return; |
373 Clear(); | 380 Clear(); |
374 MergeFrom(from); | 381 MergeFrom(from); |
375 } | 382 } |
376 | 383 |
377 bool Any::IsInitialized() const { | 384 bool Any::IsInitialized() const { |
378 | |
379 return true; | 385 return true; |
380 } | 386 } |
381 | 387 |
382 void Any::Swap(Any* other) { | 388 void Any::Swap(Any* other) { |
383 if (other == this) return; | 389 if (other == this) return; |
384 InternalSwap(other); | 390 InternalSwap(other); |
385 } | 391 } |
386 void Any::InternalSwap(Any* other) { | 392 void Any::InternalSwap(Any* other) { |
387 type_url_.Swap(&other->type_url_); | 393 type_url_.Swap(&other->type_url_); |
388 value_.Swap(&other->value_); | 394 value_.Swap(&other->value_); |
389 _internal_metadata_.Swap(&other->_internal_metadata_); | |
390 std::swap(_cached_size_, other->_cached_size_); | 395 std::swap(_cached_size_, other->_cached_size_); |
391 } | 396 } |
392 | 397 |
393 ::google::protobuf::Metadata Any::GetMetadata() const { | 398 ::google::protobuf::Metadata Any::GetMetadata() const { |
394 protobuf_AssignDescriptorsOnce(); | 399 protobuf_AssignDescriptorsOnce(); |
395 ::google::protobuf::Metadata metadata; | 400 return file_level_metadata[0]; |
396 metadata.descriptor = Any_descriptor_; | |
397 metadata.reflection = Any_reflection_; | |
398 return metadata; | |
399 } | 401 } |
400 | 402 |
401 #if PROTOBUF_INLINE_NOT_IN_HEADERS | 403 #if PROTOBUF_INLINE_NOT_IN_HEADERS |
402 // Any | 404 // Any |
403 | 405 |
404 // optional string type_url = 1; | 406 // string type_url = 1; |
405 void Any::clear_type_url() { | 407 void Any::clear_type_url() { |
406 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited()); | 408 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited()); |
407 } | 409 } |
408 const ::std::string& Any::type_url() const { | 410 const ::std::string& Any::type_url() const { |
409 // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) | 411 // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) |
410 return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlrea
dyInited()); | 412 return type_url_.GetNoArena(); |
411 } | 413 } |
412 void Any::set_type_url(const ::std::string& value) { | 414 void Any::set_type_url(const ::std::string& value) { |
413 | 415 |
414 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), value); | 416 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), value); |
415 // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) | 417 // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) |
416 } | 418 } |
417 void Any::set_type_url(const char* value) { | 419 void Any::set_type_url(const char* value) { |
418 | 420 |
419 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), ::std::string(value)); | 421 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), ::std::string(value)); |
420 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) | 422 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) |
421 } | 423 } |
422 void Any::set_type_url(const char* value, size_t size) { | 424 void Any::set_type_url(const char* value, size_t size) { |
423 | 425 |
424 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), | 426 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInite
d(), |
425 ::std::string(reinterpret_cast<const char*>(value), size)); | 427 ::std::string(reinterpret_cast<const char*>(value), size)); |
426 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url) | 428 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url) |
427 } | 429 } |
428 ::std::string* Any::mutable_type_url() { | 430 ::std::string* Any::mutable_type_url() { |
429 | 431 |
430 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) | 432 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) |
431 return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringA
lreadyInited()); | 433 return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringA
lreadyInited()); |
432 } | 434 } |
433 ::std::string* Any::release_type_url() { | 435 ::std::string* Any::release_type_url() { |
434 // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url) | 436 // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url) |
435 | 437 |
436 return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringA
lreadyInited()); | 438 return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringA
lreadyInited()); |
437 } | 439 } |
438 void Any::set_allocated_type_url(::std::string* type_url) { | 440 void Any::set_allocated_type_url(::std::string* type_url) { |
439 if (type_url != NULL) { | 441 if (type_url != NULL) { |
440 | 442 |
441 } else { | 443 } else { |
442 | 444 |
443 } | 445 } |
444 type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited(), type_url); | 446 type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlr
eadyInited(), type_url); |
445 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) | 447 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) |
446 } | 448 } |
447 | 449 |
448 // optional bytes value = 2; | 450 // bytes value = 2; |
449 void Any::clear_value() { | 451 void Any::clear_value() { |
450 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); | 452 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited()); |
451 } | 453 } |
452 const ::std::string& Any::value() const { | 454 const ::std::string& Any::value() const { |
453 // @@protoc_insertion_point(field_get:google.protobuf.Any.value) | 455 // @@protoc_insertion_point(field_get:google.protobuf.Any.value) |
454 return value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyI
nited()); | 456 return value_.GetNoArena(); |
455 } | 457 } |
456 void Any::set_value(const ::std::string& value) { | 458 void Any::set_value(const ::std::string& value) { |
457 | 459 |
458 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, value); | 460 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, value); |
459 // @@protoc_insertion_point(field_set:google.protobuf.Any.value) | 461 // @@protoc_insertion_point(field_set:google.protobuf.Any.value) |
460 } | 462 } |
461 void Any::set_value(const char* value) { | 463 void Any::set_value(const char* value) { |
462 | 464 |
463 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, ::std::string(value)); | 465 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, ::std::string(value)); |
464 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) | 466 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) |
465 } | 467 } |
466 void Any::set_value(const void* value, size_t size) { | 468 void Any::set_value(const void* value, size_t size) { |
467 | 469 |
468 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, | 470 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()
, |
469 ::std::string(reinterpret_cast<const char*>(value), size)); | 471 ::std::string(reinterpret_cast<const char*>(value), size)); |
470 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value) | 472 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value) |
471 } | 473 } |
472 ::std::string* Any::mutable_value() { | 474 ::std::string* Any::mutable_value() { |
473 | 475 |
474 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) | 476 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) |
475 return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlre
adyInited()); | 477 return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlre
adyInited()); |
476 } | 478 } |
477 ::std::string* Any::release_value() { | 479 ::std::string* Any::release_value() { |
478 // @@protoc_insertion_point(field_release:google.protobuf.Any.value) | 480 // @@protoc_insertion_point(field_release:google.protobuf.Any.value) |
479 | 481 |
480 return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlre
adyInited()); | 482 return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlre
adyInited()); |
481 } | 483 } |
482 void Any::set_allocated_value(::std::string* value) { | 484 void Any::set_allocated_value(::std::string* value) { |
483 if (value != NULL) { | 485 if (value != NULL) { |
484 | 486 |
485 } else { | 487 } else { |
486 | 488 |
487 } | 489 } |
488 value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited(), value); | 490 value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlread
yInited(), value); |
489 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) | 491 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) |
490 } | 492 } |
491 | 493 |
492 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS | 494 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
493 | 495 |
494 // @@protoc_insertion_point(namespace_scope) | 496 // @@protoc_insertion_point(namespace_scope) |
495 | 497 |
496 } // namespace protobuf | 498 } // namespace protobuf |
497 } // namespace google | 499 } // namespace google |
498 | 500 |
499 // @@protoc_insertion_point(global_scope) | 501 // @@protoc_insertion_point(global_scope) |
OLD | NEW |