wire_format_lite.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
36 
37 #include <stack>
38 #include <string>
39 #include <vector>
46 #include <google/protobuf/port_def.inc>
47 
48 
49 namespace google {
50 namespace protobuf {
51 namespace internal {
52 
53 #if !defined(_MSC_VER) || _MSC_VER >= 1900
54 // Old version of MSVC doesn't like definitions of inline constants, GCC
55 // requires them.
60 
61 #endif
62 
63 // IBM xlC requires prefixing constants with WireFormatLite::
65  io::CodedOutputStream::StaticVarintSize32<
67  io::CodedOutputStream::StaticVarintSize32<
69  io::CodedOutputStream::StaticVarintSize32<
71  io::CodedOutputStream::StaticVarintSize32<
73 
75  WireFormatLite::kFieldTypeToCppTypeMap[MAX_FIELD_TYPE + 1] = {
76  static_cast<CppType>(0), // 0 is reserved for errors
77 
78  CPPTYPE_DOUBLE, // TYPE_DOUBLE
79  CPPTYPE_FLOAT, // TYPE_FLOAT
80  CPPTYPE_INT64, // TYPE_INT64
81  CPPTYPE_UINT64, // TYPE_UINT64
82  CPPTYPE_INT32, // TYPE_INT32
83  CPPTYPE_UINT64, // TYPE_FIXED64
84  CPPTYPE_UINT32, // TYPE_FIXED32
85  CPPTYPE_BOOL, // TYPE_BOOL
86  CPPTYPE_STRING, // TYPE_STRING
87  CPPTYPE_MESSAGE, // TYPE_GROUP
88  CPPTYPE_MESSAGE, // TYPE_MESSAGE
89  CPPTYPE_STRING, // TYPE_BYTES
90  CPPTYPE_UINT32, // TYPE_UINT32
91  CPPTYPE_ENUM, // TYPE_ENUM
92  CPPTYPE_INT32, // TYPE_SFIXED32
93  CPPTYPE_INT64, // TYPE_SFIXED64
94  CPPTYPE_INT32, // TYPE_SINT32
95  CPPTYPE_INT64, // TYPE_SINT64
96 };
97 
99  WireFormatLite::kWireTypeForFieldType[MAX_FIELD_TYPE + 1] = {
100  static_cast<WireFormatLite::WireType>(-1), // invalid
101  WireFormatLite::WIRETYPE_FIXED64, // TYPE_DOUBLE
102  WireFormatLite::WIRETYPE_FIXED32, // TYPE_FLOAT
103  WireFormatLite::WIRETYPE_VARINT, // TYPE_INT64
104  WireFormatLite::WIRETYPE_VARINT, // TYPE_UINT64
105  WireFormatLite::WIRETYPE_VARINT, // TYPE_INT32
106  WireFormatLite::WIRETYPE_FIXED64, // TYPE_FIXED64
107  WireFormatLite::WIRETYPE_FIXED32, // TYPE_FIXED32
108  WireFormatLite::WIRETYPE_VARINT, // TYPE_BOOL
113  WireFormatLite::WIRETYPE_VARINT, // TYPE_UINT32
114  WireFormatLite::WIRETYPE_VARINT, // TYPE_ENUM
115  WireFormatLite::WIRETYPE_FIXED32, // TYPE_SFIXED32
116  WireFormatLite::WIRETYPE_FIXED64, // TYPE_SFIXED64
117  WireFormatLite::WIRETYPE_VARINT, // TYPE_SINT32
118  WireFormatLite::WIRETYPE_VARINT, // TYPE_SINT64
119 };
120 
122  // Field number 0 is illegal.
123  if (WireFormatLite::GetTagFieldNumber(tag) == 0) return false;
124  switch (WireFormatLite::GetTagWireType(tag)) {
126  uint64 value;
127  if (!input->ReadVarint64(&value)) return false;
128  return true;
129  }
131  uint64 value;
132  if (!input->ReadLittleEndian64(&value)) return false;
133  return true;
134  }
136  uint32 length;
137  if (!input->ReadVarint32(&length)) return false;
138  if (!input->Skip(length)) return false;
139  return true;
140  }
142  if (!input->IncrementRecursionDepth()) return false;
143  if (!SkipMessage(input)) return false;
144  input->DecrementRecursionDepth();
145  // Check that the ending tag matched the starting tag.
146  if (!input->LastTagWas(
149  return false;
150  }
151  return true;
152  }
154  return false;
155  }
157  uint32 value;
158  if (!input->ReadLittleEndian32(&value)) return false;
159  return true;
160  }
161  default: {
162  return false;
163  }
164  }
165 }
166 
169  // Field number 0 is illegal.
170  if (WireFormatLite::GetTagFieldNumber(tag) == 0) return false;
171  switch (WireFormatLite::GetTagWireType(tag)) {
173  uint64 value;
174  if (!input->ReadVarint64(&value)) return false;
175  output->WriteVarint32(tag);
176  output->WriteVarint64(value);
177  return true;
178  }
180  uint64 value;
181  if (!input->ReadLittleEndian64(&value)) return false;
182  output->WriteVarint32(tag);
183  output->WriteLittleEndian64(value);
184  return true;
185  }
187  uint32 length;
188  if (!input->ReadVarint32(&length)) return false;
189  output->WriteVarint32(tag);
190  output->WriteVarint32(length);
191  // TODO(mkilavuz): Provide API to prevent extra string copying.
192  std::string temp;
193  if (!input->ReadString(&temp, length)) return false;
194  output->WriteString(temp);
195  return true;
196  }
198  output->WriteVarint32(tag);
199  if (!input->IncrementRecursionDepth()) return false;
200  if (!SkipMessage(input, output)) return false;
201  input->DecrementRecursionDepth();
202  // Check that the ending tag matched the starting tag.
203  if (!input->LastTagWas(
206  return false;
207  }
208  return true;
209  }
211  return false;
212  }
214  uint32 value;
215  if (!input->ReadLittleEndian32(&value)) return false;
216  output->WriteVarint32(tag);
217  output->WriteLittleEndian32(value);
218  return true;
219  }
220  default: {
221  return false;
222  }
223  }
224 }
225 
227  while (true) {
228  uint32 tag = input->ReadTag();
229  if (tag == 0) {
230  // End of input. This is a valid place to end, so return true.
231  return true;
232  }
233 
235 
236  if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) {
237  // Must be the end of the message.
238  return true;
239  }
240 
241  if (!SkipField(input, tag)) return false;
242  }
243 }
244 
247  while (true) {
248  uint32 tag = input->ReadTag();
249  if (tag == 0) {
250  // End of input. This is a valid place to end, so return true.
251  return true;
252  }
253 
255 
256  if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) {
257  output->WriteVarint32(tag);
258  // Must be the end of the message.
259  return true;
260  }
261 
262  if (!SkipField(input, tag, output)) return false;
263  }
264 }
265 
267  return WireFormatLite::SkipField(input, tag);
268 }
269 
272 }
273 
274 void FieldSkipper::SkipUnknownEnum(int /* field_number */, int /* value */) {
275  // Nothing.
276 }
277 
279  uint32 tag) {
281 }
282 
285 }
286 
288  int value) {
289  unknown_fields_->WriteVarint32(field_number);
291 }
292 
294  io::CodedInputStream* input, int field_number, bool (*is_valid)(int),
295  io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values) {
296  uint32 length;
297  if (!input->ReadVarint32(&length)) return false;
298  io::CodedInputStream::Limit limit = input->PushLimit(length);
299  while (input->BytesUntilLimit() > 0) {
300  int value;
301  if (!ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(input, &value)) {
302  return false;
303  }
304  if (is_valid == NULL || is_valid(value)) {
305  values->Add(value);
306  } else {
307  uint32 tag = WireFormatLite::MakeTag(field_number,
309  unknown_fields_stream->WriteVarint32(tag);
310  unknown_fields_stream->WriteVarint32(value);
311  }
312  }
313  input->PopLimit(limit);
314  return true;
315 }
316 
317 #if !defined(PROTOBUF_LITTLE_ENDIAN)
318 
319 namespace {
320 void EncodeFixedSizeValue(float v, uint8* dest) {
322 }
323 
324 void EncodeFixedSizeValue(double v, uint8* dest) {
326 }
327 
328 void EncodeFixedSizeValue(uint32 v, uint8* dest) {
330 }
331 
332 void EncodeFixedSizeValue(uint64 v, uint8* dest) {
334 }
335 
336 void EncodeFixedSizeValue(int32 v, uint8* dest) {
338 }
339 
340 void EncodeFixedSizeValue(int64 v, uint8* dest) {
342 }
343 
344 void EncodeFixedSizeValue(bool v, uint8* dest) {
346 }
347 } // anonymous namespace
348 
349 #endif // !defined(PROTOBUF_LITTLE_ENDIAN)
350 
351 template <typename CType>
352 static void WriteArray(const CType* a, int n, io::CodedOutputStream* output) {
353 #if defined(PROTOBUF_LITTLE_ENDIAN)
354  output->WriteRaw(reinterpret_cast<const char*>(a), n * sizeof(a[0]));
355 #else
356  const int kAtATime = 128;
357  uint8 buf[sizeof(CType) * kAtATime];
358  for (int i = 0; i < n; i += kAtATime) {
359  int to_do = std::min(kAtATime, n - i);
360  uint8* ptr = buf;
361  for (int j = 0; j < to_do; j++) {
362  EncodeFixedSizeValue(a[i + j], ptr);
363  ptr += sizeof(a[0]);
364  }
365  output->WriteRaw(buf, to_do * sizeof(a[0]));
366  }
367 #endif
368 }
369 
370 void WireFormatLite::WriteFloatArray(const float* a, int n,
372  WriteArray<float>(a, n, output);
373 }
374 
375 void WireFormatLite::WriteDoubleArray(const double* a, int n,
377  WriteArray<double>(a, n, output);
378 }
379 
382  WriteArray<uint32>(a, n, output);
383 }
384 
387  WriteArray<uint64>(a, n, output);
388 }
389 
392  WriteArray<int32>(a, n, output);
393 }
394 
397  WriteArray<int64>(a, n, output);
398 }
399 
400 void WireFormatLite::WriteBoolArray(const bool* a, int n,
402  WriteArray<bool>(a, n, output);
403 }
404 
405 void WireFormatLite::WriteInt32(int field_number, int32 value,
407  WriteTag(field_number, WIRETYPE_VARINT, output);
409 }
410 void WireFormatLite::WriteInt64(int field_number, int64 value,
412  WriteTag(field_number, WIRETYPE_VARINT, output);
414 }
415 void WireFormatLite::WriteUInt32(int field_number, uint32 value,
417  WriteTag(field_number, WIRETYPE_VARINT, output);
419 }
420 void WireFormatLite::WriteUInt64(int field_number, uint64 value,
422  WriteTag(field_number, WIRETYPE_VARINT, output);
424 }
425 void WireFormatLite::WriteSInt32(int field_number, int32 value,
427  WriteTag(field_number, WIRETYPE_VARINT, output);
429 }
430 void WireFormatLite::WriteSInt64(int field_number, int64 value,
432  WriteTag(field_number, WIRETYPE_VARINT, output);
434 }
437  WriteTag(field_number, WIRETYPE_FIXED32, output);
439 }
442  WriteTag(field_number, WIRETYPE_FIXED64, output);
444 }
447  WriteTag(field_number, WIRETYPE_FIXED32, output);
449 }
452  WriteTag(field_number, WIRETYPE_FIXED64, output);
454 }
455 void WireFormatLite::WriteFloat(int field_number, float value,
457  WriteTag(field_number, WIRETYPE_FIXED32, output);
459 }
460 void WireFormatLite::WriteDouble(int field_number, double value,
462  WriteTag(field_number, WIRETYPE_FIXED64, output);
464 }
465 void WireFormatLite::WriteBool(int field_number, bool value,
467  WriteTag(field_number, WIRETYPE_VARINT, output);
469 }
470 void WireFormatLite::WriteEnum(int field_number, int value,
472  WriteTag(field_number, WIRETYPE_VARINT, output);
474 }
475 
476 void WireFormatLite::WriteString(int field_number, const std::string& value,
478  // String is for UTF-8 text only
479  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
481  output->WriteVarint32(value.size());
482  output->WriteString(value);
483 }
485  const std::string& value,
487  // String is for UTF-8 text only
488  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
490  output->WriteVarint32(value.size());
491  output->WriteRawMaybeAliased(value.data(), value.size());
492 }
493 void WireFormatLite::WriteBytes(int field_number, const std::string& value,
495  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
497  output->WriteVarint32(value.size());
498  output->WriteString(value);
499 }
501  const std::string& value,
503  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
505  output->WriteVarint32(value.size());
506  output->WriteRawMaybeAliased(value.data(), value.size());
507 }
508 
509 
510 void WireFormatLite::WriteGroup(int field_number, const MessageLite& value,
512  WriteTag(field_number, WIRETYPE_START_GROUP, output);
513  value.SerializeWithCachedSizes(output);
514  WriteTag(field_number, WIRETYPE_END_GROUP, output);
515 }
516 
517 void WireFormatLite::WriteMessage(int field_number, const MessageLite& value,
519  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
520  const int size = value.GetCachedSize();
521  output->WriteVarint32(size);
522  value.SerializeWithCachedSizes(output);
523 }
524 
527  if (!output->IsSerializationDeterministic()) {
528  uint8* target = output->GetDirectBufferForNBytesAndAdvance(size);
529  if (target != nullptr) {
530  uint8* end = value.InternalSerializeWithCachedSizesToArray(target);
532  return;
533  }
534  }
535  value.SerializeWithCachedSizes(output);
536 }
537 
539  const MessageLite& value,
541  WriteTag(field_number, WIRETYPE_START_GROUP, output);
542  const int size = value.GetCachedSize();
544  WriteTag(field_number, WIRETYPE_END_GROUP, output);
545 }
546 
548  const MessageLite& value,
550  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
551  const int size = value.GetCachedSize();
552  output->WriteVarint32(size);
554 }
555 
556 PROTOBUF_ALWAYS_INLINE static bool ReadBytesToString(
559  std::string* value) {
560  uint32 length;
561  return input->ReadVarint32(&length) &&
562  input->InternalReadStringInline(value, length);
563 }
564 
566  std::string* value) {
567  return ReadBytesToString(input, value);
568 }
569 
571  if (*p == &GetEmptyStringAlreadyInited()) {
572  *p = new std::string();
573  }
574  return ReadBytesToString(input, *p);
575 }
576 
577 void PrintUTF8ErrorLog(const char* field_name, const char* operation_str,
578  bool emit_stacktrace) {
579  std::string stacktrace;
580  std::string quoted_field_name = "";
581  if (field_name != nullptr) {
582  quoted_field_name = StringPrintf(" '%s'", field_name);
583  }
584  GOOGLE_LOG(ERROR) << "String field" << quoted_field_name << " contains invalid "
585  << "UTF-8 data when " << operation_str << " a protocol "
586  << "buffer. Use the 'bytes' type if you intend to send raw "
587  << "bytes. " << stacktrace;
588 }
589 
591  const char* field_name) {
593  const char* operation_str = NULL;
594  switch (op) {
595  case PARSE:
596  operation_str = "parsing";
597  break;
598  case SERIALIZE:
599  operation_str = "serializing";
600  break;
601  // no default case: have the compiler warn if a case is not covered.
602  }
603  PrintUTF8ErrorLog(field_name, operation_str, false);
604  return false;
605  }
606  return true;
607 }
608 
609 // this code is deliberately written such that clang makes it into really
610 // efficient SSE code.
611 template <bool ZigZag, bool SignExtended, typename T>
612 static size_t VarintSize(const T* data, const int n) {
613 #if __cplusplus >= 201103L
614  static_assert(sizeof(T) == 4, "This routine only works for 32 bit integers");
615  // is_unsigned<T> => !ZigZag
616  static_assert(
618  "Cannot ZigZag encode unsigned types");
619  // is_unsigned<T> => !SignExtended
620  static_assert(
622  "Cannot SignExtended unsigned types");
623  static_assert(!(SignExtended && ZigZag),
624  "Cannot SignExtended and ZigZag on the same type");
625 #endif
626  uint32 sum = n;
627  uint32 msb_sum = 0;
628  for (int i = 0; i < n; i++) {
629  uint32 x = data[i];
630  if (ZigZag) {
632  } else if (SignExtended) {
633  msb_sum += x >> 31;
634  }
635  // clang is so smart that it produces optimal SSE sequence unrolling
636  // the loop 8 ints at a time. With a sequence of 4
637  // cmpres = cmpgt x, sizeclass ( -1 or 0)
638  // sum = sum - cmpres
639  if (x > 0x7F) sum++;
640  if (x > 0x3FFF) sum++;
641  if (x > 0x1FFFFF) sum++;
642  if (x > 0xFFFFFFF) sum++;
643  }
644  if (SignExtended) sum += msb_sum * 5;
645  return sum;
646 }
647 
648 template <bool ZigZag, typename T>
649 static size_t VarintSize64(const T* data, const int n) {
650 #if __cplusplus >= 201103L
651  static_assert(sizeof(T) == 8, "This routine only works for 64 bit integers");
652  // is_unsigned<T> => !ZigZag
653  static_assert(!ZigZag || !std::is_unsigned<T>::value,
654  "Cannot ZigZag encode unsigned types");
655 #endif
656  uint64 sum = n;
657  for (int i = 0; i < n; i++) {
658  uint64 x = data[i];
659  if (ZigZag) {
661  }
662  // First step is a binary search, we can't branch in sse so we use the
663  // result of the compare to adjust sum and appropriately. This code is
664  // written to make clang recognize the vectorization.
665  uint64 tmp = x >= (static_cast<uint64>(1) << 35) ? -1 : 0;
666  sum += 5 & tmp;
667  x >>= 35 & tmp;
668  if (x > 0x7F) sum++;
669  if (x > 0x3FFF) sum++;
670  if (x > 0x1FFFFF) sum++;
671  if (x > 0xFFFFFFF) sum++;
672  }
673  return sum;
674 }
675 
676 // GCC does not recognize the vectorization opportunity
677 // and other platforms are untested, in those cases using the optimized
678 // varint size routine for each element is faster.
679 // Hence we enable it only for clang
680 #if defined(__SSE__) && defined(__clang__)
682  return VarintSize<false, true>(value.data(), value.size());
683 }
684 
686  return VarintSize<false, false>(value.data(), value.size());
687 }
688 
690  return VarintSize<true, false>(value.data(), value.size());
691 }
692 
694  // On ILP64, sizeof(int) == 8, which would require a different template.
695  return VarintSize<false, true>(value.data(), value.size());
696 }
697 
698 #else // !(defined(__SSE4_1__) && defined(__clang__))
699 
701  size_t out = 0;
702  const int n = value.size();
703  for (int i = 0; i < n; i++) {
704  out += Int32Size(value.Get(i));
705  }
706  return out;
707 }
708 
710  size_t out = 0;
711  const int n = value.size();
712  for (int i = 0; i < n; i++) {
713  out += UInt32Size(value.Get(i));
714  }
715  return out;
716 }
717 
719  size_t out = 0;
720  const int n = value.size();
721  for (int i = 0; i < n; i++) {
722  out += SInt32Size(value.Get(i));
723  }
724  return out;
725 }
726 
728  size_t out = 0;
729  const int n = value.size();
730  for (int i = 0; i < n; i++) {
731  out += EnumSize(value.Get(i));
732  }
733  return out;
734 }
735 
736 #endif
737 
738 // Micro benchmarks show that the SSE improved loop only starts beating
739 // the normal loop on Haswell platforms and then only for >32 ints. We
740 // disable this for now. Some specialized users might find it worthwhile to
741 // enable this.
742 #define USE_SSE_FOR_64_BIT_INTEGER_ARRAYS 0
743 #if USE_SSE_FOR_64_BIT_INTEGER_ARRAYS
745  return VarintSize64<false>(value.data(), value.size());
746 }
747 
749  return VarintSize64<false>(value.data(), value.size());
750 }
751 
753  return VarintSize64<true>(value.data(), value.size());
754 }
755 
756 #else
757 
759  size_t out = 0;
760  const int n = value.size();
761  for (int i = 0; i < n; i++) {
762  out += Int64Size(value.Get(i));
763  }
764  return out;
765 }
766 
768  size_t out = 0;
769  const int n = value.size();
770  for (int i = 0; i < n; i++) {
771  out += UInt64Size(value.Get(i));
772  }
773  return out;
774 }
775 
777  size_t out = 0;
778  const int n = value.size();
779  for (int i = 0; i < n; i++) {
780  out += SInt64Size(value.Get(i));
781  }
782  return out;
783 }
784 
785 #endif
786 
787 } // namespace internal
788 } // namespace protobuf
789 } // namespace google
zero_copy_stream.h
google::protobuf.internal::WireFormatLite::EnumSize
static size_t EnumSize(int value)
Definition: wire_format_lite.h:1743
google::protobuf.internal::WireFormatLite::WriteUInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1289
google::protobuf.internal::WireFormatLite::ReadBytes
static bool ReadBytes(io::CodedInputStream *input, std::string *value)
Definition: wire_format_lite.cc:565
google::protobuf.internal::WireFormatLite::WriteSInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1293
google::protobuf::value
const Descriptor::ReservedRange value
Definition: src/google/protobuf/descriptor.h:1954
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed64NoTagToArray(int64 value, uint8 *target)
Definition: wire_format_lite.h:1402
google::protobuf.internal::WireFormatLite::WriteUInt64
static void WriteUInt64(int field_number, uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:420
wire_format_lite.h
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED32
@ WIRETYPE_FIXED32
Definition: wire_format_lite.h:107
google::protobuf.internal::WireFormatLite::WIRETYPE_VARINT
@ WIRETYPE_VARINT
Definition: wire_format_lite.h:102
google::protobuf.internal::WireFormatLite::PARSE
@ PARSE
Definition: wire_format_lite.h:323
end
GLuint GLuint end
Definition: glcorearb.h:2858
google::protobuf.internal::VarintSize
static size_t VarintSize(const T *data, const int n)
Definition: wire_format_lite.cc:612
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
length
GLenum GLuint GLenum GLsizei length
Definition: glcorearb.h:2695
input
std::string input
Definition: tokenizer_unittest.cc:197
google::protobuf.internal::WireFormatLite::ReadPackedEnumPreserveUnknowns
static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream *input, int field_number, bool(*is_valid)(int), io::CodedOutputStream *unknown_fields_stream, RepeatedField< int > *values)
Definition: wire_format_lite.cc:293
google::protobuf::io::CodedOutputStream::WriteVarint64
void WriteVarint64(uint64 value)
Definition: coded_stream.h:1226
google::protobuf.internal::WireFormatLite::WriteFloatArray
static void WriteFloatArray(const float *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:370
google::protobuf::uint8
uint8_t uint8
Definition: protobuf/src/google/protobuf/stubs/port.h:153
google::protobuf.internal::WireFormatLite::WriteSubMessageMaybeToArray
static void WriteSubMessageMaybeToArray(int size, const MessageLite &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:525
google::protobuf.internal::WireFormatLite::ZigZagEncode64
static uint64 ZigZagEncode64(int64 n)
Definition: wire_format_lite.h:864
google::protobuf.internal::WireFormatLite::WriteFixed32Array
static void WriteFixed32Array(const uint32 *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:380
google::protobuf.internal::WireFormatLite::WriteFixed64Array
static void WriteFixed64Array(const uint64 *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:385
google::protobuf.internal::WireFormatLite::WriteDoubleArray
static void WriteDoubleArray(const double *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:375
google::protobuf.internal::WireFormatLite::SkipMessage
static bool SkipMessage(io::CodedInputStream *input)
Definition: wire_format_lite.cc:226
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf.internal::WireFormatLite::WriteDoubleNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteDoubleNoTagToArray(double value, uint8 *target)
Definition: wire_format_lite.h:1412
google::protobuf.internal::WireFormatLite::WriteGroupMaybeToArray
static void WriteGroupMaybeToArray(int field_number, const MessageLite &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:538
google::protobuf.internal::WireFormatLite::ZigZagEncode32
static uint32 ZigZagEncode32(int32 n)
Definition: wire_format_lite.h:853
google::protobuf.internal::WireFormatLite::WriteUInt32
static void WriteUInt32(int field_number, uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:415
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf.internal::WireFormatLite::kMessageSetItemEndTag
static const int kMessageSetItemEndTag
Definition: wire_format_lite.h:217
google::protobuf::RepeatedField< int >
google::protobuf.internal::WireFormatLite::WIRETYPE_END_GROUP
@ WIRETYPE_END_GROUP
Definition: wire_format_lite.h:106
google::protobuf.internal::WireFormatLite::WriteBoolNoTag
static PROTOBUF_ALWAYS_INLINE void WriteBoolNoTag(bool value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1325
google::protobuf::MessageLite
Definition: message_lite.h:183
target
GLenum target
Definition: glcorearb.h:3739
google::protobuf.internal::WireFormatLite::WriteSFixed64Array
static void WriteSFixed64Array(const int64 *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:395
x
GLint GLenum GLint x
Definition: glcorearb.h:2834
google::protobuf.internal::WireFormatLite::CppType
CppType
Definition: wire_format_lite.h:134
google::protobuf.internal::WireFormatLite::kMessageSetTypeIdTag
static const int kMessageSetTypeIdTag
Definition: wire_format_lite.h:219
google::protobuf.internal::WireFormatLite::WriteDouble
static void WriteDouble(int field_number, double value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:460
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::WireFormatLite::SkipField
static bool SkipField(io::CodedInputStream *input, uint32 tag)
Definition: wire_format_lite.cc:121
google::uint32
uint32_t uint32
Definition: sdk/include/aditof/log.h:59
google::protobuf.internal::WireFormatLite::SInt32Size
static size_t SInt32Size(int32 value)
Definition: wire_format_lite.h:1737
google::protobuf.internal::WireFormatLite::kMessageSetMessageTag
static const int kMessageSetMessageTag
Definition: wire_format_lite.h:221
google::protobuf.internal::VarintSize64
static size_t VarintSize64(const T *data, const int n)
Definition: wire_format_lite.cc:649
google::protobuf.internal::WireFormatLite::WriteEnumNoTag
static PROTOBUF_ALWAYS_INLINE void WriteEnumNoTag(int value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1329
google::protobuf.internal::WireFormatLite::WriteBoolArray
static void WriteBoolArray(const bool *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:400
values
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:3591
google::protobuf.internal::WireFormatLite::WriteBytes
static void WriteBytes(int field_number, const std::string &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:493
google::protobuf.internal::WireFormatLite::kWireTypeForFieldType
static const WireFormatLite::WireType kWireTypeForFieldType[]
Definition: wire_format_lite.h:715
google::protobuf.internal::WireFormatLite::WriteGroup
static void WriteGroup(int field_number, const MessageLite &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:510
google::protobuf.internal::WireFormatLite::WriteSFixed32Array
static void WriteSFixed32Array(const int32 *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:390
google::protobuf::int32
int32_t int32
Definition: protobuf/src/google/protobuf/stubs/port.h:150
google::protobuf.internal::WireFormatLite::WriteBool
static void WriteBool(int field_number, bool value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:465
google::protobuf.internal::WireFormatLite::Operation
Operation
Definition: wire_format_lite.h:322
google::protobuf.internal::WireFormatLite::WriteFixed32
static void WriteFixed32(int field_number, uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:435
google::protobuf.internal::WireFormatLite::WriteSInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1297
google::protobuf.internal::WireFormatLite::WriteString
static void WriteString(int field_number, const std::string &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:476
google::protobuf.internal::WireFormatLite::WriteInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1281
google::protobuf.internal::WireFormatLite::Int64Size
static size_t Int64Size(int64 value)
Definition: wire_format_lite.h:1728
google::protobuf.internal::WireFormatLite::WriteFloatNoTag
static PROTOBUF_ALWAYS_INLINE void WriteFloatNoTag(float value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1317
p
const char * p
Definition: gmock-matchers_test.cc:3863
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: logging.h:146
google::protobuf.internal::ReadBytesToString
static PROTOBUF_ALWAYS_INLINE bool ReadBytesToString(io::CodedInputStream *input, std::string *value)
Definition: wire_format_lite.cc:558
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED64
@ WIRETYPE_FIXED64
Definition: wire_format_lite.h:103
google::protobuf.internal::FieldSkipper::SkipUnknownEnum
virtual void SkipUnknownEnum(int field_number, int value)
Definition: wire_format_lite.cc:274
google::protobuf.internal::WireFormatLite::VerifyUtf8String
static bool VerifyUtf8String(const char *data, int size, Operation op, const char *field_name)
Definition: wire_format_lite.cc:590
google::protobuf::uint64
uint64_t uint64
Definition: protobuf/src/google/protobuf/stubs/port.h:156
google::protobuf.internal::WireFormatLite::SInt64Size
static size_t SInt64Size(int64 value)
Definition: wire_format_lite.h:1740
google::protobuf.internal::WireFormatLite::MakeTag
constexpr static uint32 MakeTag(int field_number, WireType type)
Definition: wire_format_lite.h:768
google::protobuf.internal::WireFormatLite::WriteInt64
static void WriteInt64(int field_number, int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:410
google::protobuf.internal::WireFormatLite::WriteFloat
static void WriteFloat(int field_number, float value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:455
google::protobuf::StringPrintf
string StringPrintf(const char *format,...)
Definition: stringprintf.cc:109
GOOGLE_CHECK_LE
#define GOOGLE_CHECK_LE(A, B)
Definition: logging.h:159
google::protobuf.internal::WireFormatLite::WriteFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64NoTagToArray(uint64 value, uint8 *target)
Definition: wire_format_lite.h:1393
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:4175
google::protobuf::ERROR
static const LogLevel ERROR
Definition: protobuf/src/google/protobuf/testing/googletest.h:70
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: wire_format_lite.h:104
google::protobuf.internal::WireFormatLite::GetTagFieldNumber
static int GetTagFieldNumber(uint32 tag)
Definition: wire_format_lite.h:777
google::protobuf.internal::PrintUTF8ErrorLog
void PrintUTF8ErrorLog(const char *field_name, const char *operation_str, bool emit_stacktrace)
Definition: wire_format_lite.cc:577
n
GLdouble n
Definition: glcorearb.h:4153
google::protobuf::io::CodedOutputStream
Definition: coded_stream.h:693
google::protobuf.internal::WireFormatLite::WriteInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1277
i
int i
Definition: gmock-matchers_test.cc:764
zero_copy_stream_impl_lite.h
google::protobuf.internal::WireFormatLite::GetTagWireType
static WireType GetTagWireType(uint32 tag)
Definition: wire_format_lite.h:773
google::protobuf.internal::WireFormatLite::WriteSInt64
static void WriteSInt64(int field_number, int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:430
google::protobuf.internal::WireFormatLite::WriteEnum
static void WriteEnum(int field_number, int value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:470
google::protobuf.internal::WireFormatLite::WriteFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1305
google::protobuf.internal::FieldSkipper::SkipMessage
virtual bool SkipMessage(io::CodedInputStream *input)
Definition: wire_format_lite.cc:270
google::protobuf.internal::CodedOutputStreamFieldSkipper::SkipMessage
bool SkipMessage(io::CodedInputStream *input) override
Definition: wire_format_lite.cc:283
google::protobuf::kint32max
static const int32 kint32max
Definition: protobuf/src/google/protobuf/stubs/port.h:159
v
const GLdouble * v
Definition: glcorearb.h:3106
common.h
google::protobuf.internal::WireFormatLite::WriteDoubleNoTag
static PROTOBUF_ALWAYS_INLINE void WriteDoubleNoTag(double value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1321
google::protobuf.internal::WireFormatLite::WriteTag
static PROTOBUF_ALWAYS_INLINE void WriteTag(int field_number, WireType type, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1272
google::protobuf.internal::FieldSkipper::SkipField
virtual bool SkipField(io::CodedInputStream *input, uint32 tag)
Definition: wire_format_lite.cc:266
google::protobuf.internal::CodedOutputStreamFieldSkipper::SkipField
bool SkipField(io::CodedInputStream *input, uint32 tag) override
Definition: wire_format_lite.cc:278
benchmarks.python.py_benchmark.dest
dest
Definition: py_benchmark.py:13
google::protobuf.internal::WireFormatLite::WriteSFixed64
static void WriteSFixed64(int field_number, int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:450
google::protobuf.internal::IsStructurallyValidUTF8
PROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char *buf, int len)
Definition: structurally_valid.cc:556
size
GLsizeiptr size
Definition: glcorearb.h:2943
google::protobuf.internal::WireFormatLite::WriteBoolNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolNoTagToArray(bool value, uint8 *target)
Definition: wire_format_lite.h:1417
google::protobuf.internal::WireFormatLite::WriteMessageMaybeToArray
static void WriteMessageMaybeToArray(int field_number, const MessageLite &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:547
google::protobuf.internal::WireFormatLite::SERIALIZE
@ SERIALIZE
Definition: wire_format_lite.h:324
google::protobuf.internal::WriteArray
static void WriteArray(const CType *a, int n, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:352
google::protobuf::io::CodedInputStream
Definition: coded_stream.h:173
stringprintf.h
google::protobuf.internal::WireFormatLite::kMessageSetItemTagsSize
static const size_t kMessageSetItemTagsSize
Definition: wire_format_lite.h:225
logging.h
google::protobuf.internal::GetEmptyStringAlreadyInited
const PROTOBUF_EXPORT std::string & GetEmptyStringAlreadyInited()
Definition: message_lite.h:152
google::protobuf.internal::WireFormatLite::WIRETYPE_START_GROUP
@ WIRETYPE_START_GROUP
Definition: wire_format_lite.h:105
google::protobuf.internal::WireFormatLite::WireType
WireType
Definition: wire_format_lite.h:101
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1313
coded_stream_inl.h
google::protobuf.internal::WireFormatLite::WriteFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1301
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
google::protobuf.internal::WireFormatLite::WriteMessage
static void WriteMessage(int field_number, const MessageLite &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:517
google::protobuf.internal::CodedOutputStreamFieldSkipper::SkipUnknownEnum
void SkipUnknownEnum(int field_number, int value) override
Definition: wire_format_lite.cc:287
google::protobuf.internal::WireFormatLite::WriteBytesMaybeAliased
static void WriteBytesMaybeAliased(int field_number, const std::string &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:500
google::protobuf.internal::WireFormatLite::WriteSInt32
static void WriteSInt32(int field_number, int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:425
internal
Definition: any.pb.h:40
google::protobuf.internal::WireFormatLite::UInt32Size
static size_t UInt32Size(uint32 value)
Definition: wire_format_lite.h:1731
google::protobuf::io::CodedInputStream::Limit
int Limit
Definition: coded_stream.h:350
google::protobuf.internal::WireFormatLite::WriteFixed64
static void WriteFixed64(int field_number, uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:440
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed32NoTagToArray(int32 value, uint8 *target)
Definition: wire_format_lite.h:1397
google::protobuf.internal::WireFormatLite::WriteFloatNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFloatNoTagToArray(float value, uint8 *target)
Definition: wire_format_lite.h:1407
google::uint8
uint8_t uint8
Definition: sdk/include/aditof/log.h:57
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1309
google::protobuf.internal::WireFormatLite::Int32Size
static size_t Int32Size(int32 value)
Definition: wire_format_lite.h:1725
google::protobuf.internal::CodedOutputStreamFieldSkipper::unknown_fields_
io::CodedOutputStream * unknown_fields_
Definition: wire_format_lite.h:758
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
google::protobuf.internal::WireFormatLite::kFieldTypeToCppTypeMap
static const CppType kFieldTypeToCppTypeMap[]
Definition: wire_format_lite.h:714
google::protobuf.internal::WireFormatLite::WriteFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32NoTagToArray(uint32 value, uint8 *target)
Definition: wire_format_lite.h:1389
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
google::protobuf.internal::WireFormatLite::WriteUInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1285
google::protobuf.internal::WireFormatLite::kMessageSetItemStartTag
static const int kMessageSetItemStartTag
Definition: wire_format_lite.h:215
google::protobuf.internal::WireFormatLite::WriteSFixed32
static void WriteSFixed32(int field_number, int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:445
google::protobuf::io::CodedOutputStream::WriteVarint32
void WriteVarint32(uint32 value)
Definition: coded_stream.h:1213
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf.internal::WireFormatLite::WriteInt32
static void WriteInt32(int field_number, int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:405
google::protobuf.internal::WireFormatLite::WriteStringMaybeAliased
static void WriteStringMaybeAliased(int field_number, const std::string &value, io::CodedOutputStream *output)
Definition: wire_format_lite.cc:484
google::protobuf.internal::WireFormatLite::UInt64Size
static size_t UInt64Size(uint64 value)
Definition: wire_format_lite.h:1734
RepeatedField
Definition: ruby/ext/google/protobuf_c/protobuf.h:395
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: logging.h:196


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:01