Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: third_party/protobuf/src/google/protobuf/any.pb.cc

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

Powered by Google App Engine
This is Rietveld 408576698