protobuf/src/google/protobuf/wire_format_lite.h
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 // atenasio@google.com (Chris Atenasio) (ZigZag transform)
33 // wink@google.com (Wink Saville) (refactored from wire_format.h)
34 // Based on original Protocol Buffers design by
35 // Sanjay Ghemawat, Jeff Dean, and others.
36 //
37 // This header is logically internal, but is made public because it is used
38 // from protocol-compiler-generated code, which may reside in other components.
39 
40 #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
41 #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
42 
43 #include <string>
44 
45 #include <google/protobuf/stubs/common.h>
46 #include <google/protobuf/stubs/logging.h>
47 #include <google/protobuf/io/coded_stream.h>
48 #include <google/protobuf/arenastring.h>
49 #include <google/protobuf/message_lite.h>
50 #include <google/protobuf/port.h>
51 #include <google/protobuf/repeated_field.h>
52 #include <google/protobuf/stubs/casts.h>
53 
54 // Do UTF-8 validation on string type in Debug build only
55 #ifndef NDEBUG
56 #define GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
57 #endif
58 
59 // Avoid conflict with iOS where <ConditionalMacros.h> #defines TYPE_BOOL.
60 //
61 // If some one needs the macro TYPE_BOOL in a file that includes this header,
62 // it's possible to bring it back using push/pop_macro as follows.
63 //
64 // #pragma push_macro("TYPE_BOOL")
65 // #include this header and/or all headers that need the macro to be undefined.
66 // #pragma pop_macro("TYPE_BOOL")
67 #undef TYPE_BOOL
68 
69 
70 #include <google/protobuf/port_def.inc>
71 
72 namespace google {
73 namespace protobuf {
74 namespace internal {
75 
76 // This class is for internal use by the protocol buffer library and by
77 // protocol-compiler-generated message classes. It must not be called
78 // directly by clients.
79 //
80 // This class contains helpers for implementing the binary protocol buffer
81 // wire format without the need for reflection. Use WireFormat when using
82 // reflection.
83 //
84 // This class is really a namespace that contains only static methods.
85 class PROTOBUF_EXPORT WireFormatLite {
86  public:
87  // -----------------------------------------------------------------
88  // Helper constants and functions related to the format. These are
89  // mostly meant for internal and generated code to use.
90 
91  // The wire format is composed of a sequence of tag/value pairs, each
92  // of which contains the value of one field (or one element of a repeated
93  // field). Each tag is encoded as a varint. The lower bits of the tag
94  // identify its wire type, which specifies the format of the data to follow.
95  // The rest of the bits contain the field number. Each type of field (as
96  // declared by FieldDescriptor::Type, in descriptor.h) maps to one of
97  // these wire types. Immediately following each tag is the field's value,
98  // encoded in the format specified by the wire type. Because the tag
99  // identifies the encoding of this data, it is possible to skip
100  // unrecognized fields for forwards compatibility.
101 
102  enum WireType {
103  WIRETYPE_VARINT = 0,
104  WIRETYPE_FIXED64 = 1,
107  WIRETYPE_END_GROUP = 4,
108  WIRETYPE_FIXED32 = 5,
109  };
110 
111  // Lite alternative to FieldDescriptor::Type. Must be kept in sync.
112  enum FieldType {
113  TYPE_DOUBLE = 1,
114  TYPE_FLOAT = 2,
115  TYPE_INT64 = 3,
116  TYPE_UINT64 = 4,
117  TYPE_INT32 = 5,
118  TYPE_FIXED64 = 6,
119  TYPE_FIXED32 = 7,
120  TYPE_BOOL = 8,
121  TYPE_STRING = 9,
122  TYPE_GROUP = 10,
123  TYPE_MESSAGE = 11,
124  TYPE_BYTES = 12,
125  TYPE_UINT32 = 13,
126  TYPE_ENUM = 14,
127  TYPE_SFIXED32 = 15,
128  TYPE_SFIXED64 = 16,
129  TYPE_SINT32 = 17,
130  TYPE_SINT64 = 18,
131  MAX_FIELD_TYPE = 18,
132  };
133 
134  // Lite alternative to FieldDescriptor::CppType. Must be kept in sync.
135  enum CppType {
136  CPPTYPE_INT32 = 1,
137  CPPTYPE_INT64 = 2,
138  CPPTYPE_UINT32 = 3,
139  CPPTYPE_UINT64 = 4,
140  CPPTYPE_DOUBLE = 5,
141  CPPTYPE_FLOAT = 6,
142  CPPTYPE_BOOL = 7,
143  CPPTYPE_ENUM = 8,
144  CPPTYPE_STRING = 9,
145  CPPTYPE_MESSAGE = 10,
146  MAX_CPPTYPE = 10,
147  };
148 
149  // Helper method to get the CppType for a particular Type.
150  static CppType FieldTypeToCppType(FieldType type);
151 
152  // Given a FieldDescriptor::Type return its WireType
155  return kWireTypeForFieldType[type];
156  }
157 
158  // Number of bits in a tag which identify the wire type.
159  static constexpr int kTagTypeBits = 3;
160  // Mask for those bits.
161  static constexpr uint32_t kTagTypeMask = (1 << kTagTypeBits) - 1;
162 
163  // Helper functions for encoding and decoding tags. (Inlined below and in
164  // _inl.h)
165  //
166  // This is different from MakeTag(field->number(), field->type()) in the
167  // case of packed repeated fields.
168  constexpr static uint32_t MakeTag(int field_number, WireType type);
169  static WireType GetTagWireType(uint32_t tag);
170  static int GetTagFieldNumber(uint32_t tag);
171 
172  // Compute the byte size of a tag. For groups, this includes both the start
173  // and end tags.
174  static inline size_t TagSize(int field_number,
176 
177  // Skips a field value with the given tag. The input should start
178  // positioned immediately after the tag. Skipped values are simply
179  // discarded, not recorded anywhere. See WireFormat::SkipField() for a
180  // version that records to an UnknownFieldSet.
182 
183  // Skips a field value with the given tag. The input should start
184  // positioned immediately after the tag. Skipped values are recorded to a
185  // CodedOutputStream.
188 
189  // Reads and ignores a message from the input. Skipped values are simply
190  // discarded, not recorded anywhere. See WireFormat::SkipMessage() for a
191  // version that records to an UnknownFieldSet.
192  static bool SkipMessage(io::CodedInputStream* input);
193 
194  // Reads and ignores a message from the input. Skipped values are recorded
195  // to a CodedOutputStream.
196  static bool SkipMessage(io::CodedInputStream* input,
198 
199  // This macro does the same thing as WireFormatLite::MakeTag(), but the
200  // result is usable as a compile-time constant, which makes it usable
201  // as a switch case or a template input. WireFormatLite::MakeTag() is more
202  // type-safe, though, so prefer it if possible.
203 #define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE) \
204  static_cast<uint32_t>((static_cast<uint32_t>(FIELD_NUMBER) << 3) | (TYPE))
205 
206  // These are the tags for the old MessageSet format, which was defined as:
207  // message MessageSet {
208  // repeated group Item = 1 {
209  // required int32 type_id = 2;
210  // required string message = 3;
211  // }
212  // }
213  static constexpr int kMessageSetItemNumber = 1;
214  static constexpr int kMessageSetTypeIdNumber = 2;
215  static constexpr int kMessageSetMessageNumber = 3;
216  static const int kMessageSetItemStartTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
217  kMessageSetItemNumber, WireFormatLite::WIRETYPE_START_GROUP);
218  static const int kMessageSetItemEndTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
219  kMessageSetItemNumber, WireFormatLite::WIRETYPE_END_GROUP);
220  static const int kMessageSetTypeIdTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
221  kMessageSetTypeIdNumber, WireFormatLite::WIRETYPE_VARINT);
222  static const int kMessageSetMessageTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
223  kMessageSetMessageNumber, WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
224 
225  // Byte size of all tags of a MessageSet::Item combined.
226  static const size_t kMessageSetItemTagsSize;
227 
228  // Helper functions for converting between floats/doubles and IEEE-754
229  // uint32s/uint64s so that they can be written. (Assumes your platform
230  // uses IEEE-754 floats.)
231  static uint32_t EncodeFloat(float value);
232  static float DecodeFloat(uint32_t value);
233  static uint64_t EncodeDouble(double value);
234  static double DecodeDouble(uint64_t value);
235 
236  // Helper functions for mapping signed integers to unsigned integers in
237  // such a way that numbers with small magnitudes will encode to smaller
238  // varints. If you simply static_cast a negative number to an unsigned
239  // number and varint-encode it, it will always take 10 bytes, defeating
240  // the purpose of varint. So, for the "sint32" and "sint64" field types,
241  // we ZigZag-encode the values.
242  static uint32_t ZigZagEncode32(int32_t n);
243  static int32_t ZigZagDecode32(uint32_t n);
244  static uint64_t ZigZagEncode64(int64_t n);
245  static int64_t ZigZagDecode64(uint64_t n);
246 
247  // =================================================================
248  // Methods for reading/writing individual field.
249 
250  // Read fields, not including tags. The assumption is that you already
251  // read the tag to determine what field to read.
252 
253  // For primitive fields, we just use a templatized routine parameterized by
254  // the represented type and the FieldType. These are specialized with the
255  // appropriate definition for each declared type.
256  template <typename CType, enum FieldType DeclaredType>
257  PROTOBUF_NDEBUG_INLINE static bool ReadPrimitive(io::CodedInputStream* input,
258  CType* value);
259 
260  // Reads repeated primitive values, with optimizations for repeats.
261  // tag_size and tag should both be compile-time constants provided by the
262  // protocol compiler.
263  template <typename CType, enum FieldType DeclaredType>
264  PROTOBUF_NDEBUG_INLINE static bool ReadRepeatedPrimitive(
265  int tag_size, uint32_t tag, io::CodedInputStream* input,
267 
268  // Identical to ReadRepeatedPrimitive, except will not inline the
269  // implementation.
270  template <typename CType, enum FieldType DeclaredType>
271  static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32_t tag,
274 
275  // Reads a primitive value directly from the provided buffer. It returns a
276  // pointer past the segment of data that was read.
277  //
278  // This is only implemented for the types with fixed wire size, e.g.
279  // float, double, and the (s)fixed* types.
280  template <typename CType, enum FieldType DeclaredType>
281  PROTOBUF_NDEBUG_INLINE static const uint8_t* ReadPrimitiveFromArray(
282  const uint8_t* buffer, CType* value);
283 
284  // Reads a primitive packed field.
285  //
286  // This is only implemented for packable types.
287  template <typename CType, enum FieldType DeclaredType>
288  PROTOBUF_NDEBUG_INLINE static bool ReadPackedPrimitive(
290 
291  // Identical to ReadPackedPrimitive, except will not inline the
292  // implementation.
293  template <typename CType, enum FieldType DeclaredType>
294  static bool ReadPackedPrimitiveNoInline(io::CodedInputStream* input,
296 
297  // Read a packed enum field. If the is_valid function is not nullptr, values
298  // for which is_valid(value) returns false are silently dropped.
299  static bool ReadPackedEnumNoInline(io::CodedInputStream* input,
300  bool (*is_valid)(int),
302 
303  // Read a packed enum field. If the is_valid function is not nullptr, values
304  // for which is_valid(value) returns false are appended to
305  // unknown_fields_stream.
306  static bool ReadPackedEnumPreserveUnknowns(
307  io::CodedInputStream* input, int field_number, bool (*is_valid)(int),
308  io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values);
309 
310  // Read a string. ReadString(..., std::string* value) requires an
311  // existing std::string.
312  static inline bool ReadString(io::CodedInputStream* input,
313  std::string* value);
314  // ReadString(..., std::string** p) is internal-only, and should only be
315  // called from generated code. It starts by setting *p to "new std::string" if
316  // *p == &GetEmptyStringAlreadyInited(). It then invokes
317  // ReadString(io::CodedInputStream* input, *p). This is useful for reducing
318  // code size.
319  static inline bool ReadString(io::CodedInputStream* input, std::string** p);
320  // Analogous to ReadString().
322  static bool ReadBytes(io::CodedInputStream* input, std::string** p);
323 
324  enum Operation {
325  PARSE = 0,
326  SERIALIZE = 1,
327  };
328 
329  // Returns true if the data is valid UTF-8.
330  static bool VerifyUtf8String(const char* data, int size, Operation op,
331  const char* field_name);
332 
333  template <typename MessageType>
334  static inline bool ReadGroup(int field_number, io::CodedInputStream* input,
335  MessageType* value);
336 
337  template <typename MessageType>
338  static inline bool ReadMessage(io::CodedInputStream* input,
339  MessageType* value);
340 
341  template <typename MessageType>
343  MessageType* value) {
344  return ReadMessage(input, value);
345  }
346 
347  // Write a tag. The Write*() functions typically include the tag, so
348  // normally there's no need to call this unless using the Write*NoTag()
349  // variants.
350  PROTOBUF_NDEBUG_INLINE static void WriteTag(int field_number, WireType type,
352 
353  // Write fields, without tags.
354  PROTOBUF_NDEBUG_INLINE static void WriteInt32NoTag(
356  PROTOBUF_NDEBUG_INLINE static void WriteInt64NoTag(
358  PROTOBUF_NDEBUG_INLINE static void WriteUInt32NoTag(
360  PROTOBUF_NDEBUG_INLINE static void WriteUInt64NoTag(
362  PROTOBUF_NDEBUG_INLINE static void WriteSInt32NoTag(
364  PROTOBUF_NDEBUG_INLINE static void WriteSInt64NoTag(
366  PROTOBUF_NDEBUG_INLINE static void WriteFixed32NoTag(
368  PROTOBUF_NDEBUG_INLINE static void WriteFixed64NoTag(
370  PROTOBUF_NDEBUG_INLINE static void WriteSFixed32NoTag(
372  PROTOBUF_NDEBUG_INLINE static void WriteSFixed64NoTag(
374  PROTOBUF_NDEBUG_INLINE static void WriteFloatNoTag(
376  PROTOBUF_NDEBUG_INLINE static void WriteDoubleNoTag(
378  PROTOBUF_NDEBUG_INLINE static void WriteBoolNoTag(
380  PROTOBUF_NDEBUG_INLINE static void WriteEnumNoTag(
382 
383  // Write array of primitive fields, without tags
384  static void WriteFloatArray(const float* a, int n,
386  static void WriteDoubleArray(const double* a, int n,
388  static void WriteFixed32Array(const uint32_t* a, int n,
390  static void WriteFixed64Array(const uint64_t* a, int n,
392  static void WriteSFixed32Array(const int32_t* a, int n,
394  static void WriteSFixed64Array(const int64_t* a, int n,
396  static void WriteBoolArray(const bool* a, int n,
398 
399  // Write fields, including tags.
400  static void WriteInt32(int field_number, int32_t value,
402  static void WriteInt64(int field_number, int64_t value,
404  static void WriteUInt32(int field_number, uint32_t value,
406  static void WriteUInt64(int field_number, uint64_t value,
408  static void WriteSInt32(int field_number, int32_t value,
410  static void WriteSInt64(int field_number, int64_t value,
412  static void WriteFixed32(int field_number, uint32_t value,
414  static void WriteFixed64(int field_number, uint64_t value,
416  static void WriteSFixed32(int field_number, int32_t value,
418  static void WriteSFixed64(int field_number, int64_t value,
420  static void WriteFloat(int field_number, float value,
422  static void WriteDouble(int field_number, double value,
424  static void WriteBool(int field_number, bool value,
426  static void WriteEnum(int field_number, int value,
428 
429  static void WriteString(int field_number, const std::string& value,
431  static void WriteBytes(int field_number, const std::string& value,
433  static void WriteStringMaybeAliased(int field_number,
434  const std::string& value,
436  static void WriteBytesMaybeAliased(int field_number, const std::string& value,
438 
439  static void WriteGroup(int field_number, const MessageLite& value,
441  static void WriteMessage(int field_number, const MessageLite& value,
443  // Like above, but these will check if the output stream has enough
444  // space to write directly to a flat array.
445  static void WriteGroupMaybeToArray(int field_number, const MessageLite& value,
447  static void WriteMessageMaybeToArray(int field_number,
448  const MessageLite& value,
450 
451  // Like above, but de-virtualize the call to SerializeWithCachedSizes(). The
452  // pointer must point at an instance of MessageType, *not* a subclass (or
453  // the subclass must not override SerializeWithCachedSizes()).
454  template <typename MessageType>
455  static inline void WriteGroupNoVirtual(int field_number,
456  const MessageType& value,
458  template <typename MessageType>
459  static inline void WriteMessageNoVirtual(int field_number,
460  const MessageType& value,
462 
463  // Like above, but use only *ToArray methods of CodedOutputStream.
464  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteTagToArray(int field_number,
465  WireType type,
466  uint8_t* target);
467 
468  // Write fields, without tags.
469  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32NoTagToArray(
471  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64NoTagToArray(
473  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32NoTagToArray(
475  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64NoTagToArray(
477  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32NoTagToArray(
479  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64NoTagToArray(
481  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32NoTagToArray(
483  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64NoTagToArray(
485  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32NoTagToArray(
487  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64NoTagToArray(
489  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatNoTagToArray(
490  float value, uint8_t* target);
491  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleNoTagToArray(
492  double value, uint8_t* target);
493  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolNoTagToArray(bool value,
494  uint8_t* target);
495  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumNoTagToArray(int value,
496  uint8_t* target);
497 
498  // Write fields, without tags. These require that value.size() > 0.
499  template <typename T>
500  PROTOBUF_NDEBUG_INLINE static uint8_t* WritePrimitiveNoTagToArray(
501  const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
502  uint8_t* target);
503  template <typename T>
504  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixedNoTagToArray(
505  const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
506  uint8_t* target);
507 
508  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32NoTagToArray(
510  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64NoTagToArray(
512  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32NoTagToArray(
514  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64NoTagToArray(
516  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32NoTagToArray(
518  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64NoTagToArray(
520  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32NoTagToArray(
522  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64NoTagToArray(
524  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32NoTagToArray(
526  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64NoTagToArray(
528  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatNoTagToArray(
530  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleNoTagToArray(
532  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolNoTagToArray(
534  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumNoTagToArray(
536 
537  // Write fields, including tags.
538  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32ToArray(int field_number,
539  int32_t value,
540  uint8_t* target);
541  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64ToArray(int field_number,
542  int64_t value,
543  uint8_t* target);
544  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32ToArray(int field_number,
545  uint32_t value,
546  uint8_t* target);
547  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64ToArray(int field_number,
548  uint64_t value,
549  uint8_t* target);
550  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32ToArray(int field_number,
551  int32_t value,
552  uint8_t* target);
553  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64ToArray(int field_number,
554  int64_t value,
555  uint8_t* target);
556  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32ToArray(int field_number,
557  uint32_t value,
558  uint8_t* target);
559  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64ToArray(int field_number,
560  uint64_t value,
561  uint8_t* target);
562  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32ToArray(int field_number,
563  int32_t value,
564  uint8_t* target);
565  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64ToArray(int field_number,
566  int64_t value,
567  uint8_t* target);
568  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatToArray(int field_number,
569  float value,
570  uint8_t* target);
571  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleToArray(int field_number,
572  double value,
573  uint8_t* target);
574  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolToArray(int field_number,
575  bool value,
576  uint8_t* target);
577  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumToArray(int field_number,
578  int value,
579  uint8_t* target);
580 
581  template <typename T>
582  PROTOBUF_NDEBUG_INLINE static uint8_t* WritePrimitiveToArray(
583  int field_number, const RepeatedField<T>& value,
584  uint8_t* (*Writer)(int, T, uint8_t*), uint8_t* target);
585 
586  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32ToArray(
587  int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
588  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64ToArray(
589  int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
590  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32ToArray(
591  int field_number, const RepeatedField<uint32_t>& value, uint8_t* output);
592  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64ToArray(
593  int field_number, const RepeatedField<uint64_t>& value, uint8_t* output);
594  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32ToArray(
595  int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
596  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64ToArray(
597  int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
598  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32ToArray(
599  int field_number, const RepeatedField<uint32_t>& value, uint8_t* output);
600  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64ToArray(
601  int field_number, const RepeatedField<uint64_t>& value, uint8_t* output);
602  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32ToArray(
603  int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
604  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64ToArray(
605  int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
606  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatToArray(
607  int field_number, const RepeatedField<float>& value, uint8_t* output);
608  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleToArray(
609  int field_number, const RepeatedField<double>& value, uint8_t* output);
610  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolToArray(
611  int field_number, const RepeatedField<bool>& value, uint8_t* output);
612  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumToArray(
613  int field_number, const RepeatedField<int>& value, uint8_t* output);
614 
615  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteStringToArray(
616  int field_number, const std::string& value, uint8_t* target);
617  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBytesToArray(
618  int field_number, const std::string& value, uint8_t* target);
619 
620  // Whether to serialize deterministically (e.g., map keys are
621  // sorted) is a property of a CodedOutputStream, and in the process
622  // of serialization, the "ToArray" variants may be invoked. But they don't
623  // have a CodedOutputStream available, so they get an additional parameter
624  // telling them whether to serialize deterministically.
625  template <typename MessageType>
626  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteGroup(
627  int field_number, const MessageType& value, uint8_t* target,
629  template <typename MessageType>
630  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteMessage(
631  int field_number, const MessageType& value, uint8_t* target,
633 
634  // Like above, but de-virtualize the call to SerializeWithCachedSizes(). The
635  // pointer must point at an instance of MessageType, *not* a subclass (or
636  // the subclass must not override SerializeWithCachedSizes()).
637  template <typename MessageType>
638  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteGroupNoVirtualToArray(
639  int field_number, const MessageType& value, uint8_t* target);
640  template <typename MessageType>
641  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteMessageNoVirtualToArray(
642  int field_number, const MessageType& value, uint8_t* target);
643 
644  // For backward-compatibility, the last four methods also have versions
645  // that are non-deterministic always.
646  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteGroupToArray(
647  int field_number, const MessageLite& value, uint8_t* target) {
649  target,
650  value.GetCachedSize() +
651  static_cast<int>(2 * io::CodedOutputStream::VarintSize32(
652  static_cast<uint32_t>(field_number) << 3)),
654  return InternalWriteGroup(field_number, value, target, &stream);
655  }
656  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteMessageToArray(
657  int field_number, const MessageLite& value, uint8_t* target) {
658  int size = value.GetCachedSize();
660  target,
661  size + static_cast<int>(io::CodedOutputStream::VarintSize32(
662  static_cast<uint32_t>(field_number) << 3) +
665  return InternalWriteMessage(field_number, value, target, &stream);
666  }
667 
668  // Compute the byte size of a field. The XxSize() functions do NOT include
669  // the tag, so you must also call TagSize(). (This is because, for repeated
670  // fields, you should only call TagSize() once and multiply it by the element
671  // count, but you may have to call XxSize() for each individual element.)
672  static inline size_t Int32Size(int32_t value);
673  static inline size_t Int64Size(int64_t value);
674  static inline size_t UInt32Size(uint32_t value);
675  static inline size_t UInt64Size(uint64_t value);
676  static inline size_t SInt32Size(int32_t value);
677  static inline size_t SInt64Size(int64_t value);
678  static inline size_t EnumSize(int value);
679  static inline size_t Int32SizePlusOne(int32_t value);
680  static inline size_t Int64SizePlusOne(int64_t value);
681  static inline size_t UInt32SizePlusOne(uint32_t value);
682  static inline size_t UInt64SizePlusOne(uint64_t value);
683  static inline size_t SInt32SizePlusOne(int32_t value);
684  static inline size_t SInt64SizePlusOne(int64_t value);
685  static inline size_t EnumSizePlusOne(int value);
686 
687  static size_t Int32Size(const RepeatedField<int32_t>& value);
688  static size_t Int64Size(const RepeatedField<int64_t>& value);
689  static size_t UInt32Size(const RepeatedField<uint32_t>& value);
690  static size_t UInt64Size(const RepeatedField<uint64_t>& value);
691  static size_t SInt32Size(const RepeatedField<int32_t>& value);
692  static size_t SInt64Size(const RepeatedField<int64_t>& value);
693  static size_t EnumSize(const RepeatedField<int>& value);
694 
695  // These types always have the same size.
696  static constexpr size_t kFixed32Size = 4;
697  static constexpr size_t kFixed64Size = 8;
698  static constexpr size_t kSFixed32Size = 4;
699  static constexpr size_t kSFixed64Size = 8;
700  static constexpr size_t kFloatSize = 4;
701  static constexpr size_t kDoubleSize = 8;
702  static constexpr size_t kBoolSize = 1;
703 
704  static inline size_t StringSize(const std::string& value);
705  static inline size_t BytesSize(const std::string& value);
706 
707  template <typename MessageType>
708  static inline size_t GroupSize(const MessageType& value);
709  template <typename MessageType>
710  static inline size_t MessageSize(const MessageType& value);
711 
712  // Like above, but de-virtualize the call to ByteSize(). The
713  // pointer must point at an instance of MessageType, *not* a subclass (or
714  // the subclass must not override ByteSize()).
715  template <typename MessageType>
716  static inline size_t GroupSizeNoVirtual(const MessageType& value);
717  template <typename MessageType>
718  static inline size_t MessageSizeNoVirtual(const MessageType& value);
719 
720  // Given the length of data, calculate the byte size of the data on the
721  // wire if we encode the data as a length delimited field.
722  static inline size_t LengthDelimitedSize(size_t length);
723 
724  private:
725  // A helper method for the repeated primitive reader. This method has
726  // optimizations for primitive types that have fixed size on the wire, and
727  // can be read using potentially faster paths.
728  template <typename CType, enum FieldType DeclaredType>
729  PROTOBUF_NDEBUG_INLINE static bool ReadRepeatedFixedSizePrimitive(
730  int tag_size, uint32_t tag, io::CodedInputStream* input,
732 
733  // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
734  template <typename CType, enum FieldType DeclaredType>
735  PROTOBUF_NDEBUG_INLINE static bool ReadPackedFixedSizePrimitive(
737 
738  static const CppType kFieldTypeToCppTypeMap[];
739  static const WireFormatLite::WireType kWireTypeForFieldType[];
740  static void WriteSubMessageMaybeToArray(int size, const MessageLite& value,
742 
744 };
745 
746 // A class which deals with unknown values. The default implementation just
747 // discards them. WireFormat defines a subclass which writes to an
748 // UnknownFieldSet. This class is used by ExtensionSet::ParseField(), since
749 // ExtensionSet is part of the lite library but UnknownFieldSet is not.
750 class PROTOBUF_EXPORT FieldSkipper {
751  public:
753  virtual ~FieldSkipper() {}
754 
755  // Skip a field whose tag has already been consumed.
757 
758  // Skip an entire message or group, up to an end-group tag (which is consumed)
759  // or end-of-stream.
760  virtual bool SkipMessage(io::CodedInputStream* input);
761 
762  // Deal with an already-parsed unrecognized enum value. The default
763  // implementation does nothing, but the UnknownFieldSet-based implementation
764  // saves it as an unknown varint.
765  virtual void SkipUnknownEnum(int field_number, int value);
766 };
767 
768 // Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.
769 
770 class PROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
771  public:
773  : unknown_fields_(unknown_fields) {}
775 
776  // implements FieldSkipper -----------------------------------------
778  bool SkipMessage(io::CodedInputStream* input) override;
779  void SkipUnknownEnum(int field_number, int value) override;
780 
781  protected:
782  io::CodedOutputStream* unknown_fields_;
783 };
784 
785 // inline methods ====================================================
786 
788  FieldType type) {
790 }
791 
792 constexpr inline uint32_t WireFormatLite::MakeTag(int field_number,
793  WireType type) {
794  return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(field_number, type);
795 }
796 
798  return static_cast<WireType>(tag & kTagTypeMask);
799 }
800 
802  return static_cast<int>(tag >> kTagTypeBits);
803 }
804 
805 inline size_t WireFormatLite::TagSize(int field_number,
808  static_cast<uint32_t>(field_number << kTagTypeBits));
809  if (type == TYPE_GROUP) {
810  // Groups have both a start and an end tag.
811  return result * 2;
812  } else {
813  return result;
814  }
815 }
816 
818  return bit_cast<uint32_t>(value);
819 }
820 
822  return bit_cast<float>(value);
823 }
824 
826  return bit_cast<uint64_t>(value);
827 }
828 
830  return bit_cast<double>(value);
831 }
832 
833 // ZigZag Transform: Encodes signed integers so that they can be
834 // effectively used with varint encoding.
835 //
836 // varint operates on unsigned integers, encoding smaller numbers into
837 // fewer bytes. If you try to use it on a signed integer, it will treat
838 // this number as a very large unsigned integer, which means that even
839 // small signed numbers like -1 will take the maximum number of bytes
840 // (10) to encode. ZigZagEncode() maps signed integers to unsigned
841 // in such a way that those with a small absolute value will have smaller
842 // encoded values, making them appropriate for encoding using varint.
843 //
844 // int32_t -> uint32_t
845 // -------------------------
846 // 0 -> 0
847 // -1 -> 1
848 // 1 -> 2
849 // -2 -> 3
850 // ... -> ...
851 // 2147483647 -> 4294967294
852 // -2147483648 -> 4294967295
853 //
854 // >> encode >>
855 // << decode <<
856 
858  // Note: the right-shift must be arithmetic
859  // Note: left shift must be unsigned because of overflow
860  return (static_cast<uint32_t>(n) << 1) ^ static_cast<uint32_t>(n >> 31);
861 }
862 
864  // Note: Using unsigned types prevent undefined behavior
865  return static_cast<int32_t>((n >> 1) ^ (~(n & 1) + 1));
866 }
867 
869  // Note: the right-shift must be arithmetic
870  // Note: left shift must be unsigned because of overflow
871  return (static_cast<uint64_t>(n) << 1) ^ static_cast<uint64_t>(n >> 63);
872 }
873 
875  // Note: Using unsigned types prevent undefined behavior
876  return static_cast<int64_t>((n >> 1) ^ (~(n & 1) + 1));
877 }
878 
879 // String is for UTF-8 text only, but, even so, ReadString() can simply
880 // call ReadBytes().
881 
883  std::string* value) {
884  return ReadBytes(input, value);
885 }
886 
888  std::string** p) {
889  return ReadBytes(input, p);
890 }
891 
893  const std::string& unknown_fields, uint8_t* target,
894  io::EpsCopyOutputStream* stream) {
895  return stream->WriteRaw(unknown_fields.data(),
896  static_cast<int>(unknown_fields.size()), target);
897 }
898 
900  const std::string& unknown_fields) {
901  return unknown_fields.size();
902 }
903 
904 // Implementation details of ReadPrimitive.
905 
906 template <>
907 inline bool WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_INT32>(
909  uint32_t temp;
910  if (!input->ReadVarint32(&temp)) return false;
911  *value = static_cast<int32_t>(temp);
912  return true;
913 }
914 template <>
915 inline bool WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_INT64>(
917  uint64_t temp;
918  if (!input->ReadVarint64(&temp)) return false;
919  *value = static_cast<int64_t>(temp);
920  return true;
921 }
922 template <>
923 inline bool
924 WireFormatLite::ReadPrimitive<uint32_t, WireFormatLite::TYPE_UINT32>(
926  return input->ReadVarint32(value);
927 }
928 template <>
929 inline bool
930 WireFormatLite::ReadPrimitive<uint64_t, WireFormatLite::TYPE_UINT64>(
932  return input->ReadVarint64(value);
933 }
934 template <>
935 inline bool WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_SINT32>(
937  uint32_t temp;
938  if (!input->ReadVarint32(&temp)) return false;
940  return true;
941 }
942 template <>
943 inline bool WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_SINT64>(
945  uint64_t temp;
946  if (!input->ReadVarint64(&temp)) return false;
948  return true;
949 }
950 template <>
951 inline bool
952 WireFormatLite::ReadPrimitive<uint32_t, WireFormatLite::TYPE_FIXED32>(
954  return input->ReadLittleEndian32(value);
955 }
956 template <>
957 inline bool
958 WireFormatLite::ReadPrimitive<uint64_t, WireFormatLite::TYPE_FIXED64>(
960  return input->ReadLittleEndian64(value);
961 }
962 template <>
963 inline bool
964 WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_SFIXED32>(
966  uint32_t temp;
967  if (!input->ReadLittleEndian32(&temp)) return false;
968  *value = static_cast<int32_t>(temp);
969  return true;
970 }
971 template <>
972 inline bool
973 WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_SFIXED64>(
975  uint64_t temp;
976  if (!input->ReadLittleEndian64(&temp)) return false;
977  *value = static_cast<int64_t>(temp);
978  return true;
979 }
980 template <>
981 inline bool WireFormatLite::ReadPrimitive<float, WireFormatLite::TYPE_FLOAT>(
982  io::CodedInputStream* input, float* value) {
983  uint32_t temp;
984  if (!input->ReadLittleEndian32(&temp)) return false;
985  *value = DecodeFloat(temp);
986  return true;
987 }
988 template <>
989 inline bool WireFormatLite::ReadPrimitive<double, WireFormatLite::TYPE_DOUBLE>(
990  io::CodedInputStream* input, double* value) {
991  uint64_t temp;
992  if (!input->ReadLittleEndian64(&temp)) return false;
993  *value = DecodeDouble(temp);
994  return true;
995 }
996 template <>
997 inline bool WireFormatLite::ReadPrimitive<bool, WireFormatLite::TYPE_BOOL>(
998  io::CodedInputStream* input, bool* value) {
999  uint64_t temp;
1000  if (!input->ReadVarint64(&temp)) return false;
1001  *value = temp != 0;
1002  return true;
1003 }
1004 template <>
1005 inline bool WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
1006  io::CodedInputStream* input, int* value) {
1007  uint32_t temp;
1008  if (!input->ReadVarint32(&temp)) return false;
1009  *value = static_cast<int>(temp);
1010  return true;
1011 }
1012 
1013 template <>
1014 inline const uint8_t*
1015 WireFormatLite::ReadPrimitiveFromArray<uint32_t, WireFormatLite::TYPE_FIXED32>(
1016  const uint8_t* buffer, uint32_t* value) {
1018 }
1019 template <>
1020 inline const uint8_t*
1021 WireFormatLite::ReadPrimitiveFromArray<uint64_t, WireFormatLite::TYPE_FIXED64>(
1022  const uint8_t* buffer, uint64_t* value) {
1024 }
1025 template <>
1026 inline const uint8_t*
1027 WireFormatLite::ReadPrimitiveFromArray<int32_t, WireFormatLite::TYPE_SFIXED32>(
1028  const uint8_t* buffer, int32_t* value) {
1029  uint32_t temp;
1031  *value = static_cast<int32_t>(temp);
1032  return buffer;
1033 }
1034 template <>
1035 inline const uint8_t*
1036 WireFormatLite::ReadPrimitiveFromArray<int64_t, WireFormatLite::TYPE_SFIXED64>(
1037  const uint8_t* buffer, int64_t* value) {
1038  uint64_t temp;
1040  *value = static_cast<int64_t>(temp);
1041  return buffer;
1042 }
1043 template <>
1044 inline const uint8_t*
1045 WireFormatLite::ReadPrimitiveFromArray<float, WireFormatLite::TYPE_FLOAT>(
1046  const uint8_t* buffer, float* value) {
1047  uint32_t temp;
1049  *value = DecodeFloat(temp);
1050  return buffer;
1051 }
1052 template <>
1053 inline const uint8_t*
1054 WireFormatLite::ReadPrimitiveFromArray<double, WireFormatLite::TYPE_DOUBLE>(
1055  const uint8_t* buffer, double* value) {
1056  uint64_t temp;
1058  *value = DecodeDouble(temp);
1059  return buffer;
1060 }
1061 
1062 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1064  int, // tag_size, unused.
1066  CType value;
1067  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1068  values->Add(value);
1069  int elements_already_reserved = values->Capacity() - values->size();
1070  while (elements_already_reserved > 0 && input->ExpectTag(tag)) {
1071  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1072  values->AddAlreadyReserved(value);
1073  elements_already_reserved--;
1074  }
1075  return true;
1076 }
1077 
1078 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1080  int tag_size, uint32_t tag, io::CodedInputStream* input,
1082  GOOGLE_DCHECK_EQ(UInt32Size(tag), static_cast<size_t>(tag_size));
1083  CType value;
1084  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1085  values->Add(value);
1086 
1087  // For fixed size values, repeated values can be read more quickly by
1088  // reading directly from a raw array.
1089  //
1090  // We can get a tight loop by only reading as many elements as can be
1091  // added to the RepeatedField without having to do any resizing. Additionally,
1092  // we only try to read as many elements as are available from the current
1093  // buffer space. Doing so avoids having to perform boundary checks when
1094  // reading the value: the maximum number of elements that can be read is
1095  // known outside of the loop.
1096  const void* void_pointer;
1097  int size;
1098  input->GetDirectBufferPointerInline(&void_pointer, &size);
1099  if (size > 0) {
1100  const uint8_t* buffer = reinterpret_cast<const uint8_t*>(void_pointer);
1101  // The number of bytes each type occupies on the wire.
1102  const int per_value_size = tag_size + static_cast<int>(sizeof(value));
1103 
1104  // parentheses around (std::min) prevents macro expansion of min(...)
1105  int elements_available =
1106  (std::min)(values->Capacity() - values->size(), size / per_value_size);
1107  int num_read = 0;
1108  while (num_read < elements_available &&
1110  nullptr) {
1111  buffer = ReadPrimitiveFromArray<CType, DeclaredType>(buffer, &value);
1112  values->AddAlreadyReserved(value);
1113  ++num_read;
1114  }
1115  const int read_bytes = num_read * per_value_size;
1116  if (read_bytes > 0) {
1117  input->Skip(read_bytes);
1118  }
1119  }
1120  return true;
1121 }
1122 
1123 // Specializations of ReadRepeatedPrimitive for the fixed size types, which use
1124 // the optimized code path.
1125 #define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE) \
1126  template <> \
1127  inline bool WireFormatLite::ReadRepeatedPrimitive< \
1128  CPPTYPE, WireFormatLite::DECLARED_TYPE>( \
1129  int tag_size, uint32_t tag, io::CodedInputStream* input, \
1130  RepeatedField<CPPTYPE>* values) { \
1131  return ReadRepeatedFixedSizePrimitive<CPPTYPE, \
1132  WireFormatLite::DECLARED_TYPE>( \
1133  tag_size, tag, input, values); \
1134  }
1135 
1140 READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
1141 READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
1142 
1143 #undef READ_REPEATED_FIXED_SIZE_PRIMITIVE
1144 
1145 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1147  int tag_size, uint32_t tag, io::CodedInputStream* input,
1149  return ReadRepeatedPrimitive<CType, DeclaredType>(tag_size, tag, input,
1150  value);
1151 }
1152 
1153 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1156  int length;
1157  if (!input->ReadVarintSizeAsInt(&length)) return false;
1158  io::CodedInputStream::Limit limit = input->PushLimit(length);
1159  while (input->BytesUntilLimit() > 0) {
1160  CType value;
1161  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1162  values->Add(value);
1163  }
1164  input->PopLimit(limit);
1165  return true;
1166 }
1167 
1168 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1171  int length;
1172  if (!input->ReadVarintSizeAsInt(&length)) return false;
1173  const int old_entries = values->size();
1174  const int new_entries = length / static_cast<int>(sizeof(CType));
1175  const int new_bytes = new_entries * static_cast<int>(sizeof(CType));
1176  if (new_bytes != length) return false;
1177  // We would *like* to pre-allocate the buffer to write into (for
1178  // speed), but *must* avoid performing a very large allocation due
1179  // to a malicious user-supplied "length" above. So we have a fast
1180  // path that pre-allocates when the "length" is less than a bound.
1181  // We determine the bound by calling BytesUntilTotalBytesLimit() and
1182  // BytesUntilLimit(). These return -1 to mean "no limit set".
1183  // There are four cases:
1184  // TotalBytesLimit Limit
1185  // -1 -1 Use slow path.
1186  // -1 >= 0 Use fast path if length <= Limit.
1187  // >= 0 -1 Use slow path.
1188  // >= 0 >= 0 Use fast path if length <= min(both limits).
1189  int64_t bytes_limit = input->BytesUntilTotalBytesLimit();
1190  if (bytes_limit == -1) {
1191  bytes_limit = input->BytesUntilLimit();
1192  } else {
1193  // parentheses around (std::min) prevents macro expansion of min(...)
1194  bytes_limit =
1195  (std::min)(bytes_limit, static_cast<int64_t>(input->BytesUntilLimit()));
1196  }
1197  if (bytes_limit >= new_bytes) {
1198  // Fast-path that pre-allocates *values to the final size.
1199 #if defined(PROTOBUF_LITTLE_ENDIAN)
1200  values->Resize(old_entries + new_entries, 0);
1201  // values->mutable_data() may change after Resize(), so do this after:
1202  void* dest = reinterpret_cast<void*>(values->mutable_data() + old_entries);
1203  if (!input->ReadRaw(dest, new_bytes)) {
1204  values->Truncate(old_entries);
1205  return false;
1206  }
1207 #else
1208  values->Reserve(old_entries + new_entries);
1209  CType value;
1210  for (int i = 0; i < new_entries; ++i) {
1211  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1212  values->AddAlreadyReserved(value);
1213  }
1214 #endif
1215  } else {
1216  // This is the slow-path case where "length" may be too large to
1217  // safely allocate. We read as much as we can into *values
1218  // without pre-allocating "length" bytes.
1219  CType value;
1220  for (int i = 0; i < new_entries; ++i) {
1221  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1222  values->Add(value);
1223  }
1224  }
1225  return true;
1226 }
1227 
1228 // Specializations of ReadPackedPrimitive for the fixed size types, which use
1229 // an optimized code path.
1230 #define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE) \
1231  template <> \
1232  inline bool \
1233  WireFormatLite::ReadPackedPrimitive<CPPTYPE, WireFormatLite::DECLARED_TYPE>( \
1234  io::CodedInputStream * input, RepeatedField<CPPTYPE> * values) { \
1235  return ReadPackedFixedSizePrimitive<CPPTYPE, \
1236  WireFormatLite::DECLARED_TYPE>( \
1237  input, values); \
1238  }
1239 
1245 READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
1246 
1247 #undef READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
1248 
1249 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1252  return ReadPackedPrimitive<CType, DeclaredType>(input, values);
1253 }
1254 
1255 
1256 template <typename MessageType>
1257 inline bool WireFormatLite::ReadGroup(int field_number,
1259  MessageType* value) {
1260  if (!input->IncrementRecursionDepth()) return false;
1261  if (!value->MergePartialFromCodedStream(input)) return false;
1262  input->UnsafeDecrementRecursionDepth();
1263  // Make sure the last thing read was an end tag for this group.
1264  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {
1265  return false;
1266  }
1267  return true;
1268 }
1269 template <typename MessageType>
1271  MessageType* value) {
1272  int length;
1273  if (!input->ReadVarintSizeAsInt(&length)) return false;
1274  std::pair<io::CodedInputStream::Limit, int> p =
1275  input->IncrementRecursionDepthAndPushLimit(length);
1276  if (p.second < 0 || !value->MergePartialFromCodedStream(input)) return false;
1277  // Make sure that parsing stopped when the limit was hit, not at an endgroup
1278  // tag.
1279  return input->DecrementRecursionDepthAndPopLimit(p.first);
1280 }
1281 
1282 // ===================================================================
1283 
1284 inline void WireFormatLite::WriteTag(int field_number, WireType type,
1286  output->WriteTag(MakeTag(field_number, type));
1287 }
1288 
1291  output->WriteVarint32SignExtended(value);
1292 }
1295  output->WriteVarint64(static_cast<uint64_t>(value));
1296 }
1299  output->WriteVarint32(value);
1300 }
1303  output->WriteVarint64(value);
1304 }
1307  output->WriteVarint32(ZigZagEncode32(value));
1308 }
1311  output->WriteVarint64(ZigZagEncode64(value));
1312 }
1315  output->WriteLittleEndian32(value);
1316 }
1319  output->WriteLittleEndian64(value);
1320 }
1323  output->WriteLittleEndian32(static_cast<uint32_t>(value));
1324 }
1327  output->WriteLittleEndian64(static_cast<uint64_t>(value));
1328 }
1329 inline void WireFormatLite::WriteFloatNoTag(float value,
1331  output->WriteLittleEndian32(EncodeFloat(value));
1332 }
1333 inline void WireFormatLite::WriteDoubleNoTag(double value,
1335  output->WriteLittleEndian64(EncodeDouble(value));
1336 }
1337 inline void WireFormatLite::WriteBoolNoTag(bool value,
1339  output->WriteVarint32(value ? 1 : 0);
1340 }
1341 inline void WireFormatLite::WriteEnumNoTag(int value,
1343  output->WriteVarint32SignExtended(value);
1344 }
1345 
1346 // See comment on ReadGroupNoVirtual to understand the need for this template
1347 // parameter name.
1348 template <typename MessageType_WorkAroundCppLookupDefect>
1350  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1352  WriteTag(field_number, WIRETYPE_START_GROUP, output);
1353  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
1354  WriteTag(field_number, WIRETYPE_END_GROUP, output);
1355 }
1356 template <typename MessageType_WorkAroundCppLookupDefect>
1358  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1360  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
1361  output->WriteVarint32(
1362  value.MessageType_WorkAroundCppLookupDefect::GetCachedSize());
1363  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
1364 }
1365 
1366 // ===================================================================
1367 
1368 inline uint8_t* WireFormatLite::WriteTagToArray(int field_number, WireType type,
1369  uint8_t* target) {
1370  return io::CodedOutputStream::WriteTagToArray(MakeTag(field_number, type),
1371  target);
1372 }
1373 
1375  uint8_t* target) {
1377 }
1379  uint8_t* target) {
1381  static_cast<uint64_t>(value), target);
1382 }
1384  uint8_t* target) {
1386 }
1388  uint8_t* target) {
1390 }
1392  uint8_t* target) {
1394  target);
1395 }
1397  uint8_t* target) {
1399  target);
1400 }
1402  uint8_t* target) {
1404 }
1406  uint8_t* target) {
1408 }
1410  uint8_t* target) {
1412  static_cast<uint32_t>(value), target);
1413 }
1415  uint8_t* target) {
1417  static_cast<uint64_t>(value), target);
1418 }
1420  uint8_t* target) {
1422  target);
1423 }
1425  uint8_t* target) {
1427  target);
1428 }
1430  uint8_t* target) {
1432 }
1434  uint8_t* target) {
1436 }
1437 
1438 template <typename T>
1440  const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
1441  uint8_t* target) {
1442  const int n = value.size();
1443  GOOGLE_DCHECK_GT(n, 0);
1444 
1445  const T* ii = value.data();
1446  int i = 0;
1447  do {
1448  target = Writer(ii[i], target);
1449  } while (++i < n);
1450 
1451  return target;
1452 }
1453 
1454 template <typename T>
1456  const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
1457  uint8_t* target) {
1458 #if defined(PROTOBUF_LITTLE_ENDIAN)
1459  (void)Writer;
1460 
1461  const int n = value.size();
1462  GOOGLE_DCHECK_GT(n, 0);
1463 
1464  const T* ii = value.data();
1465  const int bytes = n * static_cast<int>(sizeof(ii[0]));
1466  memcpy(target, ii, static_cast<size_t>(bytes));
1467  return target + bytes;
1468 #else
1469  return WritePrimitiveNoTagToArray(value, Writer, target);
1470 #endif
1471 }
1472 
1476 }
1480 }
1484 }
1488 }
1492 }
1496 }
1500 }
1504 }
1508 }
1512 }
1516 }
1520 }
1524 }
1528 }
1529 
1530 inline uint8_t* WireFormatLite::WriteInt32ToArray(int field_number,
1531  int32_t value,
1532  uint8_t* target) {
1533  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1535 }
1536 inline uint8_t* WireFormatLite::WriteInt64ToArray(int field_number,
1537  int64_t value,
1538  uint8_t* target) {
1539  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1541 }
1542 inline uint8_t* WireFormatLite::WriteUInt32ToArray(int field_number,
1543  uint32_t value,
1544  uint8_t* target) {
1545  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1547 }
1548 inline uint8_t* WireFormatLite::WriteUInt64ToArray(int field_number,
1549  uint64_t value,
1550  uint8_t* target) {
1551  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1553 }
1554 inline uint8_t* WireFormatLite::WriteSInt32ToArray(int field_number,
1555  int32_t value,
1556  uint8_t* target) {
1557  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1559 }
1560 inline uint8_t* WireFormatLite::WriteSInt64ToArray(int field_number,
1561  int64_t value,
1562  uint8_t* target) {
1563  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1565 }
1566 inline uint8_t* WireFormatLite::WriteFixed32ToArray(int field_number,
1567  uint32_t value,
1568  uint8_t* target) {
1569  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1571 }
1572 inline uint8_t* WireFormatLite::WriteFixed64ToArray(int field_number,
1573  uint64_t value,
1574  uint8_t* target) {
1575  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1577 }
1578 inline uint8_t* WireFormatLite::WriteSFixed32ToArray(int field_number,
1579  int32_t value,
1580  uint8_t* target) {
1581  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1583 }
1584 inline uint8_t* WireFormatLite::WriteSFixed64ToArray(int field_number,
1585  int64_t value,
1586  uint8_t* target) {
1587  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1589 }
1590 inline uint8_t* WireFormatLite::WriteFloatToArray(int field_number, float value,
1591  uint8_t* target) {
1592  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1594 }
1595 inline uint8_t* WireFormatLite::WriteDoubleToArray(int field_number,
1596  double value,
1597  uint8_t* target) {
1598  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1600 }
1601 inline uint8_t* WireFormatLite::WriteBoolToArray(int field_number, bool value,
1602  uint8_t* target) {
1603  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1605 }
1606 inline uint8_t* WireFormatLite::WriteEnumToArray(int field_number, int value,
1607  uint8_t* target) {
1608  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1610 }
1611 
1612 template <typename T>
1614  int field_number, const RepeatedField<T>& value,
1615  uint8_t* (*Writer)(int, T, uint8_t*), uint8_t* target) {
1616  const int n = value.size();
1617  if (n == 0) {
1618  return target;
1619  }
1620 
1621  const T* ii = value.data();
1622  int i = 0;
1623  do {
1624  target = Writer(field_number, ii[i], target);
1625  } while (++i < n);
1626 
1627  return target;
1628 }
1629 
1631  int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
1632  return WritePrimitiveToArray(field_number, value, WriteInt32ToArray, target);
1633 }
1635  int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
1636  return WritePrimitiveToArray(field_number, value, WriteInt64ToArray, target);
1637 }
1639  int field_number, const RepeatedField<uint32_t>& value, uint8_t* target) {
1640  return WritePrimitiveToArray(field_number, value, WriteUInt32ToArray, target);
1641 }
1643  int field_number, const RepeatedField<uint64_t>& value, uint8_t* target) {
1644  return WritePrimitiveToArray(field_number, value, WriteUInt64ToArray, target);
1645 }
1647  int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
1648  return WritePrimitiveToArray(field_number, value, WriteSInt32ToArray, target);
1649 }
1651  int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
1652  return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);
1653 }
1655  int field_number, const RepeatedField<uint32_t>& value, uint8_t* target) {
1656  return WritePrimitiveToArray(field_number, value, WriteFixed32ToArray,
1657  target);
1658 }
1660  int field_number, const RepeatedField<uint64_t>& value, uint8_t* target) {
1661  return WritePrimitiveToArray(field_number, value, WriteFixed64ToArray,
1662  target);
1663 }
1665  int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
1666  return WritePrimitiveToArray(field_number, value, WriteSFixed32ToArray,
1667  target);
1668 }
1670  int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
1671  return WritePrimitiveToArray(field_number, value, WriteSFixed64ToArray,
1672  target);
1673 }
1675  int field_number, const RepeatedField<float>& value, uint8_t* target) {
1676  return WritePrimitiveToArray(field_number, value, WriteFloatToArray, target);
1677 }
1679  int field_number, const RepeatedField<double>& value, uint8_t* target) {
1680  return WritePrimitiveToArray(field_number, value, WriteDoubleToArray, target);
1681 }
1683  int field_number, const RepeatedField<bool>& value, uint8_t* target) {
1684  return WritePrimitiveToArray(field_number, value, WriteBoolToArray, target);
1685 }
1687  int field_number, const RepeatedField<int>& value, uint8_t* target) {
1688  return WritePrimitiveToArray(field_number, value, WriteEnumToArray, target);
1689 }
1690 inline uint8_t* WireFormatLite::WriteStringToArray(int field_number,
1691  const std::string& value,
1692  uint8_t* target) {
1693  // String is for UTF-8 text only
1694  // WARNING: In wire_format.cc, both strings and bytes are handled by
1695  // WriteString() to avoid code duplication. If the implementations become
1696  // different, you will need to update that usage.
1699 }
1700 inline uint8_t* WireFormatLite::WriteBytesToArray(int field_number,
1701  const std::string& value,
1702  uint8_t* target) {
1705 }
1706 
1707 
1708 template <typename MessageType>
1710  int field_number, const MessageType& value, uint8_t* target,
1713  target = value._InternalSerialize(target, stream);
1714  target = stream->EnsureSpace(target);
1715  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
1716 }
1717 template <typename MessageType>
1719  int field_number, const MessageType& value, uint8_t* target,
1723  static_cast<uint32_t>(value.GetCachedSize()), target);
1724  return value._InternalSerialize(target, stream);
1725 }
1726 
1727 // See comment on ReadGroupNoVirtual to understand the need for this template
1728 // parameter name.
1729 template <typename MessageType_WorkAroundCppLookupDefect>
1731  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1732  uint8_t* target) {
1734  target = value.MessageType_WorkAroundCppLookupDefect:: SerializeWithCachedSizesToArray(target);
1735  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
1736 }
1737 template <typename MessageType_WorkAroundCppLookupDefect>
1739  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1740  uint8_t* target) {
1743  static_cast<uint32_t>(
1744  value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),
1745  target);
1746  return value
1747  .MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizesToArray(
1748  target);
1749 }
1750 
1751 // ===================================================================
1752 
1753 inline size_t WireFormatLite::Int32Size(int32_t value) {
1755 }
1756 inline size_t WireFormatLite::Int64Size(int64_t value) {
1757  return io::CodedOutputStream::VarintSize64(static_cast<uint64_t>(value));
1758 }
1759 inline size_t WireFormatLite::UInt32Size(uint32_t value) {
1761 }
1762 inline size_t WireFormatLite::UInt64Size(uint64_t value) {
1764 }
1765 inline size_t WireFormatLite::SInt32Size(int32_t value) {
1767 }
1768 inline size_t WireFormatLite::SInt64Size(int64_t value) {
1770 }
1771 inline size_t WireFormatLite::EnumSize(int value) {
1773 }
1776 }
1779  static_cast<uint64_t>(value));
1780 }
1783 }
1786 }
1789 }
1792 }
1793 inline size_t WireFormatLite::EnumSizePlusOne(int value) {
1795 }
1796 
1797 inline size_t WireFormatLite::StringSize(const std::string& value) {
1798  return LengthDelimitedSize(value.size());
1799 }
1800 inline size_t WireFormatLite::BytesSize(const std::string& value) {
1801  return LengthDelimitedSize(value.size());
1802 }
1803 
1804 
1805 template <typename MessageType>
1806 inline size_t WireFormatLite::GroupSize(const MessageType& value) {
1807  return value.ByteSizeLong();
1808 }
1809 template <typename MessageType>
1810 inline size_t WireFormatLite::MessageSize(const MessageType& value) {
1811  return LengthDelimitedSize(value.ByteSizeLong());
1812 }
1813 
1814 // See comment on ReadGroupNoVirtual to understand the need for this template
1815 // parameter name.
1816 template <typename MessageType_WorkAroundCppLookupDefect>
1818  const MessageType_WorkAroundCppLookupDefect& value) {
1819  return value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong();
1820 }
1821 template <typename MessageType_WorkAroundCppLookupDefect>
1823  const MessageType_WorkAroundCppLookupDefect& value) {
1824  return LengthDelimitedSize(
1825  value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong());
1826 }
1827 
1828 inline size_t WireFormatLite::LengthDelimitedSize(size_t length) {
1829  // The static_cast here prevents an error in certain compiler configurations
1830  // but is not technically correct--if length is too large to fit in a uint32_t
1831  // then it will be silently truncated. We will need to fix this if we ever
1832  // decide to start supporting serialized messages greater than 2 GiB in size.
1833  return length +
1835 }
1836 
1837 template <typename MS>
1839  // This method parses a group which should contain two fields:
1840  // required int32 type_id = 2;
1841  // required data message = 3;
1842 
1843  uint32_t last_type_id = 0;
1844 
1845  // If we see message data before the type_id, we'll append it to this so
1846  // we can parse it later.
1848 
1849  enum class State { kNoTag, kHasType, kHasPayload, kDone };
1850  State state = State::kNoTag;
1851 
1852  while (true) {
1853  const uint32_t tag = input->ReadTagNoLastTag();
1854  if (tag == 0) return false;
1855 
1856  switch (tag) {
1858  uint32_t type_id;
1859  if (!input->ReadVarint32(&type_id)) return false;
1860  if (state == State::kNoTag) {
1861  last_type_id = type_id;
1862  state = State::kHasType;
1863  } else if (state == State::kHasPayload) {
1864  // We saw some message data before the type_id. Have to parse it
1865  // now.
1866  io::CodedInputStream sub_input(
1867  reinterpret_cast<const uint8_t*>(message_data.data()),
1868  static_cast<int>(message_data.size()));
1869  sub_input.SetRecursionLimit(input->RecursionBudget());
1870  if (!ms.ParseField(type_id, &sub_input)) {
1871  return false;
1872  }
1873  message_data.clear();
1874  state = State::kDone;
1875  }
1876 
1877  break;
1878  }
1879 
1881  if (state == State::kHasType) {
1882  // Already saw type_id, so we can parse this directly.
1883  if (!ms.ParseField(last_type_id, input)) {
1884  return false;
1885  }
1886  state = State::kDone;
1887  } else if (state == State::kNoTag) {
1888  // We haven't seen a type_id yet. Append this data to message_data.
1889  uint32_t length;
1890  if (!input->ReadVarint32(&length)) return false;
1891  if (static_cast<int32_t>(length) < 0) return false;
1892  uint32_t size = static_cast<uint32_t>(
1894  message_data.resize(size);
1895  auto ptr = reinterpret_cast<uint8_t*>(&message_data[0]);
1897  if (!input->ReadRaw(ptr, length)) return false;
1898  state = State::kHasPayload;
1899  } else {
1900  if (!ms.SkipField(tag, input)) return false;
1901  }
1902 
1903  break;
1904  }
1905 
1907  return true;
1908  }
1909 
1910  default: {
1911  if (!ms.SkipField(tag, input)) return false;
1912  }
1913  }
1914  }
1915 }
1916 
1917 } // namespace internal
1918 } // namespace protobuf
1919 } // namespace google
1920 
1921 #include <google/protobuf/port_undef.inc>
1922 
1923 #endif // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
1924 
google::protobuf.internal::WireFormatLite::WriteMessageNoVirtual
static void WriteMessageNoVirtual(int field_number, const MessageType &value, io::CodedOutputStream *output)
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf.internal::WireFormatLite::EnumSize
static size_t EnumSize(int value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1763
google::protobuf.internal::WireFormatLite::WriteSFixed32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed32ToArray(int field_number, int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1571
google::protobuf.internal::WireFormatLite::WriteUInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1306
google::protobuf.internal::WireFormatLite::ReadGroup
static bool ReadGroup(int field_number, io::CodedInputStream *input, MessageType *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1262
fix_build_deps.temp
temp
Definition: fix_build_deps.py:488
google::protobuf.internal::WireFormatLite::WireTypeForFieldType
static WireFormatLite::WireType WireTypeForFieldType(WireFormatLite::FieldType type)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:153
google::protobuf.internal::WireFormatLite::ReadBytes
static bool ReadBytes(io::CodedInputStream *input, std::string *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.cc:559
google::protobuf.internal::FieldType
uint8 FieldType
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:83
google::protobuf.internal::WireFormatLite::WriteSInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1310
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf.internal::ComputeUnknownMessageSetItemsSize
size_t ComputeUnknownMessageSetItemsSize(const UnknownFieldSet &unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:376
google::protobuf.internal::WireFormatLite::WriteSInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt32NoTagToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1396
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/macros.h:40
google::protobuf.internal::WireFormatLite::WriteSInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt32ToArray(int field_number, int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1551
google::protobuf.internal::WireFormatLite::WriteFloatToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFloatToArray(int field_number, float value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1581
google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray
static uint8 * WriteStringWithSizeToArray(const std::string &str, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.cc:947
google::protobuf.internal::WireFormatLite::WriteInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt32NoTagToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1379
google::protobuf.internal::WireFormatLite::WriteStringToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteStringToArray(int field_number, const std::string &value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1682
google::protobuf.internal::WireFormatLite::WriteSInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt64ToArray(int field_number, int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1556
google::protobuf.internal::WireFormatLite::WriteUInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32ToArray(int field_number, uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1541
google::protobuf.internal::WireFormatLite::WritePrimitiveNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WritePrimitiveNoTagToArray(const RepeatedField< T > &value, uint8 *(*Writer)(T, uint8 *), uint8 *target)
google::protobuf::io::CodedOutputStream::WriteVarint64ToArray
static uint8 * WriteVarint64ToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1591
google::protobuf.internal::WireFormatLite::ReadRepeatedFixedSizePrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadRepeatedFixedSizePrimitive(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf::io::CodedOutputStream::WriteVarint32SignExtendedToArray
static uint8 * WriteVarint32SignExtendedToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1600
google::protobuf::io::CodedOutputStream::VarintSize64
static size_t VarintSize64(uint64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1664
google::protobuf.internal::WireFormatLite::MessageSize
static size_t MessageSize(const MessageType &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1780
google::protobuf.internal::FieldSkipper::FieldSkipper
FieldSkipper()
Definition: protobuf/src/google/protobuf/wire_format_lite.h:752
google::protobuf.internal::WireFormatLite::BytesSize
static size_t BytesSize(const std::string &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1770
google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic
static bool IsDefaultSerializationDeterministic()
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1232
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:104
google::protobuf.internal.wire_format.WIRETYPE_START_GROUP
int WIRETYPE_START_GROUP
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:50
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf.internal::WireFormatLite::WriteGroupNoVirtual
static void WriteGroupNoVirtual(int field_number, const MessageType &value, io::CodedOutputStream *output)
google::protobuf.internal::WireFormatLite::kFieldTypeToCppTypeMap
static const CppType kFieldTypeToCppTypeMap[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:729
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed64NoTagToArray(int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1419
google::protobuf.internal::WireFormatLite::ReadPackedFixedSizePrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadPackedFixedSizePrimitive(io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf.internal::FieldSkipper
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:741
ZigZagDecode32
#define ZigZagDecode32(x)
google::protobuf.internal::FieldSkipper::~FieldSkipper
virtual ~FieldSkipper()
Definition: protobuf/src/google/protobuf/wire_format_lite.h:753
google::protobuf::RepeatedField
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:184
google::protobuf::io::CodedOutputStream::WriteLittleEndian64ToArray
static uint8 * WriteLittleEndian64ToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1618
google::protobuf.internal::WireFormatLite::WriteBoolNoTag
static PROTOBUF_ALWAYS_INLINE void WriteBoolNoTag(bool value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1342
xds_manager.p
p
Definition: xds_manager.py:60
google::protobuf.internal::WireFormatLite::WriteUInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64NoTagToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1392
google::protobuf.internal::WireFormatLite::EncodeDouble
static uint64 EncodeDouble(double value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:826
google::protobuf::MessageLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:184
google::protobuf.internal::WireFormatLite::GroupSize
static size_t GroupSize(const MessageType &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1776
google::protobuf.internal::WireFormatLite::WriteMessageToArray
static PROTOBUF_NDEBUG_INLINE uint8_t * WriteMessageToArray(int field_number, const MessageLite &value, uint8_t *target)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:656
google::protobuf.internal::WireFormatLite::InternalWriteMessage
static PROTOBUF_NDEBUG_INLINE uint8_t * InternalWriteMessage(int field_number, const MessageType &value, uint8_t *target, io::EpsCopyOutputStream *stream)
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED64
@ WIRETYPE_FIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:103
google::protobuf.internal::WireFormatLite::CppType
CppType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:134
google::protobuf.internal::WireFormatLite::ZigZagEncode32
static uint32 ZigZagEncode32(int32 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:868
ZigZagEncode32
#define ZigZagEncode32(x)
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::WireFormatLite::SInt32Size
static size_t SInt32Size(int32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1757
google::protobuf.internal::WireFormatLite::ReadMessageNoVirtual
static bool ReadMessageNoVirtual(io::CodedInputStream *input, MessageType *value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:342
google::protobuf.internal::WireFormatLite::WriteUInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32NoTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1388
google::protobuf.internal::WireFormatLite::MakeTag
constexpr static uint32 MakeTag(int field_number, WireType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:783
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf::io::CodedOutputStream::VarintSize64PlusOne
static size_t VarintSize64PlusOne(uint64_t value)
Definition: protobuf/src/google/protobuf/io/coded_stream.h:1730
google::protobuf.internal::WireFormatLite::WriteEnumNoTag
static PROTOBUF_ALWAYS_INLINE void WriteEnumNoTag(int value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1346
google::protobuf.internal::WireFormatLite::kMessageSetItemEndTag
static const int kMessageSetItemEndTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:217
google::protobuf::io::EpsCopyOutputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:651
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
google::protobuf.internal::WireFormatLite::WriteSInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt64NoTagToArray(int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1401
google::protobuf.internal::WireFormatLite::WriteEnumToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteEnumToArray(int field_number, int value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1596
google::protobuf.internal::WireFormatLite::InternalWriteGroup
static PROTOBUF_NDEBUG_INLINE uint8_t * InternalWriteGroup(int field_number, const MessageType &value, uint8_t *target, io::EpsCopyOutputStream *stream)
google::protobuf.internal::WireFormatLite::Operation
Operation
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:322
ZigZagEncode64
#define ZigZagEncode64(x)
google::protobuf.internal::WireFormatLite::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:121
google::protobuf.internal::WireFormatLite::WriteBoolNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolNoTagToArray(bool value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1434
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
google::protobuf.internal::WireFormatLite::FieldTypeToCppType
static CppType FieldTypeToCppType(FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:778
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
GOOGLE_DCHECK_GT
#define GOOGLE_DCHECK_GT
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:200
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED32
@ WIRETYPE_FIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:107
google::protobuf.internal::WireFormatLite::WriteEnumNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteEnumNoTagToArray(int value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1437
google::protobuf.internal::WireFormatLite::WriteDoubleToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteDoubleToArray(int field_number, double value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1586
google::protobuf::io::CodedOutputStream::VarintSize32PlusOne
static size_t VarintSize32PlusOne(uint32_t value)
Definition: protobuf/src/google/protobuf/io/coded_stream.h:1714
google::protobuf.internal::WireFormatLite::ReadRepeatedPrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadRepeatedPrimitive(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf.internal::WireFormatLite::kTagTypeMask
static const uint32 kTagTypeMask
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:160
google::protobuf.internal::WireFormatLite::WriteSInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1314
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::WireFormatLite::ReadString
static bool ReadString(io::CodedInputStream *input, std::string *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:893
google::protobuf.internal::WireFormatLite::DecodeDouble
static double DecodeDouble(uint64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:835
google::protobuf.internal::WireFormatLite::WriteInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1298
google::protobuf.internal::ParseMessageSetItemImpl
bool ParseMessageSetItemImpl(io::CodedInputStream *input, MS ms)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1808
google::protobuf.internal::WireFormatLite::ReadMessage
static bool ReadMessage(io::CodedInputStream *input, MessageType *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1275
google::protobuf.internal::WireFormatLite::InternalWriteMessageNoVirtualToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteMessageNoVirtualToArray(int field_number, const MessageType &value, uint8 *target)
google::protobuf.internal::WireFormatLite::InternalWriteGroupNoVirtualToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteGroupNoVirtualToArray(int field_number, const MessageType &value, uint8 *target)
grpc::protobuf::io::CodedInputStream
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:102
google::protobuf::io::CodedOutputStream::VarintSize32
static size_t VarintSize32(uint32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1654
google::protobuf.internal::WireFormatLite::LengthDelimitedSize
static size_t LengthDelimitedSize(size_t length)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1798
google::protobuf::io::CodedOutputStream::VarintSize32SignExtended
static size_t VarintSize32SignExtended(int32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1674
google::protobuf.internal::WireFormatLite::Int64Size
static size_t Int64Size(int64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1748
google::protobuf.internal::WireFormatLite::WriteFloatNoTag
static PROTOBUF_ALWAYS_INLINE void WriteFloatNoTag(float value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1334
google::protobuf.internal::WireFormatLite::UInt64SizePlusOne
static size_t UInt64SizePlusOne(uint64_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1785
google::protobuf::io::CodedOutputStream::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1650
google::protobuf.internal::WireFormatLite::WriteFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32NoTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1406
google::protobuf.internal::WireFormatLite::ReadPackedPrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadPackedPrimitive(io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf.internal::WireFormatLite::ReadRepeatedPrimitiveNoInline
static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1151
read_bytes
static int read_bytes(int fd, char *buf, size_t read_size, int spin)
Definition: low_level_ping_pong.cc:71
google::protobuf.internal.wire_format.WIRETYPE_END_GROUP
int WIRETYPE_END_GROUP
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:51
google::protobuf.internal::WireFormatLite::SInt64Size
static size_t SInt64Size(int64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1760
google::protobuf.internal::WireFormatLite::WriteFixed64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64ToArray(int field_number, uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1566
google::protobuf.internal::WireFormatLite::FieldType
FieldType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:111
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
google::protobuf.internal.wire_format.WIRETYPE_LENGTH_DELIMITED
int WIRETYPE_LENGTH_DELIMITED
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:49
google::protobuf.internal::WireFormatLite::WriteGroupToArray
static PROTOBUF_NDEBUG_INLINE uint8_t * WriteGroupToArray(int field_number, const MessageLite &value, uint8_t *target)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:646
google::protobuf.internal::WireFormatLite::WritePrimitiveToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WritePrimitiveToArray(int field_number, const RepeatedField< T > &value, uint8 *(*Writer)(int, T, uint8 *), uint8 *target)
grpc::protobuf::io::CodedOutputStream
GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream
Definition: src/compiler/config.h:55
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
google::protobuf.internal::WireFormatLite::WriteBytesToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBytesToArray(int field_number, const std::string &value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1692
google::protobuf.internal::WireFormatLite::WIRETYPE_VARINT
@ WIRETYPE_VARINT
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:102
min
#define min(a, b)
Definition: qsort.h:83
google::protobuf.internal::WireFormatLite::GroupSizeNoVirtual
static size_t GroupSizeNoVirtual(const MessageType &value)
ZigZagDecode64
#define ZigZagDecode64(x)
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
tests.qps.qps_worker.dest
dest
Definition: qps_worker.py:45
google::protobuf.internal.wire_format.WIRETYPE_VARINT
int WIRETYPE_VARINT
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:47
google::protobuf.internal::WireFormatLite::EncodeFloat
static uint32 EncodeFloat(float value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:808
google::protobuf.internal::WireFormatLite::GetTagFieldNumber
static int GetTagFieldNumber(uint32 tag)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:792
google::protobuf.internal.wire_format.WIRETYPE_FIXED32
int WIRETYPE_FIXED32
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:52
message_data
void * message_data(MessageHeader *msg)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/message.c:250
google::protobuf::io::CodedOutputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1044
google::protobuf::io::CodedOutputStream::WriteVarint32ToArrayOutOfLine
static uint8_t * WriteVarint32ToArrayOutOfLine(uint32_t value, uint8_t *target)
Definition: protobuf/src/google/protobuf/io/coded_stream.h:1628
google::protobuf.internal::WireFormatLite::WriteInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1294
google::protobuf.internal::WireFormatLite::GetTagWireType
static WireType GetTagWireType(uint32 tag)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:788
google::protobuf.internal::WireFormatLite::MessageSizeNoVirtual
static size_t MessageSizeNoVirtual(const MessageType &value)
google::protobuf.internal::WireFormatLite::StringSize
static size_t StringSize(const std::string &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1767
google::protobuf.internal::WireFormatLite::WriteFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1322
google::protobuf.internal::WireFormatLite::WIRETYPE_START_GROUP
@ WIRETYPE_START_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:105
google::protobuf.internal::WireFormatLite::TagSize
static size_t TagSize(int field_number, WireFormatLite::FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:796
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
google::protobuf.internal::CodedOutputStreamFieldSkipper::~CodedOutputStreamFieldSkipper
~CodedOutputStreamFieldSkipper() override
Definition: protobuf/src/google/protobuf/wire_format_lite.h:774
google::protobuf.internal.decoder.SkipField
def SkipField
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/decoder.py:1036
google::protobuf.internal::WireFormatLite::WriteDoubleNoTag
static PROTOBUF_ALWAYS_INLINE void WriteDoubleNoTag(double value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1338
google::protobuf.internal::WireFormatLite::WriteFixedNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixedNoTagToArray(const RepeatedField< T > &value, uint8 *(*Writer)(T, uint8 *), uint8 *target)
google::protobuf.internal::WireFormatLite::EnumSizePlusOne
static size_t EnumSizePlusOne(int value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1794
google::protobuf.internal::WireFormatLite::WriteFloatNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFloatNoTagToArray(float value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1424
google::protobuf.internal::WireFormatLite::WriteTag
static PROTOBUF_ALWAYS_INLINE void WriteTag(int field_number, WireType type, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1289
google::protobuf.internal::CodedOutputStreamFieldSkipper::CodedOutputStreamFieldSkipper
CodedOutputStreamFieldSkipper(io::CodedOutputStream *unknown_fields)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:772
google::protobuf.internal::WireFormatLite::WriteInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt32ToArray(int field_number, int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1531
READ_REPEATED_FIXED_SIZE_PRIMITIVE
#define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1125
google::protobuf.internal::WireFormatLite::UInt32SizePlusOne
static size_t UInt32SizePlusOne(uint32_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1782
READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
#define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1230
google::protobuf.internal::WireFormatLite::ZigZagEncode64
static uint64 ZigZagEncode64(int64 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:879
GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG
#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:203
google::protobuf::io::CodedInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:180
values
std::array< int64_t, Size > values
Definition: abseil-cpp/absl/container/btree_benchmark.cc:608
google::protobuf.internal::WireFormatLite::DecodeFloat
static float DecodeFloat(uint32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:817
google::protobuf.internal::WireFormatLite::Int32SizePlusOne
static size_t Int32SizePlusOne(int32_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1775
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
google::protobuf.internal::WireFormatLite::SInt32SizePlusOne
static size_t SInt32SizePlusOne(int32_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1788
google::protobuf.internal::WireFormatLite::WriteInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt64NoTagToArray(int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1383
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf.internal::WireFormatLite::kMessageSetMessageTag
static const int kMessageSetMessageTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:221
google::protobuf.internal::WireFormatLite::WireType
WireType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:101
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed64NoTag(int64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1330
google::protobuf::io::CodedOutputStream::WriteVarint32ToArray
static uint8 * WriteVarint32ToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1586
google::protobuf.internal::WireFormatLite::WriteSFixed64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed64ToArray(int field_number, int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1576
google::protobuf.internal::WireFormatLite::WriteFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1318
google::protobuf::io::CodedInputStream::ReadLittleEndian64FromArray
static const uint8 * ReadLittleEndian64FromArray(const uint8 *buffer, uint64 *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1322
google::protobuf.internal::WireFormatLite::WIRETYPE_END_GROUP
@ WIRETYPE_END_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:106
google::protobuf.internal::WireFormatLite::SInt64SizePlusOne
static size_t SInt64SizePlusOne(int64_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1791
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf.internal::WireFormatLite::UInt32Size
static size_t UInt32Size(uint32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1751
google::protobuf::io::CodedInputStream::ReadLittleEndian32FromArray
static const uint8 * ReadLittleEndian32FromArray(const uint8 *buffer, uint32 *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1308
google::protobuf::io::CodedInputStream::Limit
int Limit
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:348
google::protobuf.internal::WireFormatLite::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(int field_number, WireType type, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1373
google::protobuf.internal::WireFormatLite::kTagTypeBits
static const int kTagTypeBits
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:158
google::protobuf.internal::WireFormatLite::WriteInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt64ToArray(int field_number, int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1536
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf.internal::WireFormatLite::ZigZagDecode64
static int64 ZigZagDecode64(uint64 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:885
google::protobuf.internal::WireFormatLite::WriteDoubleNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteDoubleNoTagToArray(double value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1429
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed32NoTag(int32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1326
google::protobuf.internal::WireFormatLite::Int32Size
static size_t Int32Size(int32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1745
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed32NoTagToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1414
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
google::protobuf.internal::WireFormatLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:84
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf.internal::WireFormatLite::WriteFixed32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32ToArray(int field_number, uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1561
google::protobuf.internal::WireFormatLite::WriteUInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64ToArray(int field_number, uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1546
google::protobuf.internal.wire_format.WIRETYPE_FIXED64
int WIRETYPE_FIXED64
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/wire_format.py:48
google::protobuf.internal::WireFormatLite::WriteBoolToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolToArray(int field_number, bool value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1591
google::protobuf.internal::WireFormatLite::WriteUInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1302
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
google::protobuf.internal::WireFormatLite::ZigZagDecode32
static int32 ZigZagDecode32(uint32 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:874
google::protobuf.internal::WireFormatLite::WriteFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64NoTagToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1410
bloaty::ReadBytes
absl::string_view ReadBytes(size_t bytes, absl::string_view *data)
Definition: bloaty/src/util.h:165
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
google::protobuf::io::CodedOutputStream::VarintSize32SignExtendedPlusOne
static size_t VarintSize32SignExtendedPlusOne(int32_t value)
Definition: protobuf/src/google/protobuf/io/coded_stream.h:1740
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
framework.infrastructure.gcp.api.Operation
Operation
Definition: api.py:60
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::io::CodedOutputStream::WriteLittleEndian32ToArray
static uint8 * WriteLittleEndian32ToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1605
google::protobuf.internal::WireFormatLite::kMessageSetTypeIdTag
static const int kMessageSetTypeIdTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:219
google::protobuf.internal::InternalSerializeUnknownMessageSetItemsToArray
uint8 * InternalSerializeUnknownMessageSetItemsToArray(const UnknownFieldSet &unknown_fields, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:369
google::protobuf::io::CodedInputStream::ExpectTagFromArray
static const PROTOBUF_ALWAYS_INLINE uint8 * ExpectTagFromArray(const uint8 *buffer, uint32 expected)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1452
google::protobuf.internal::WireFormatLite::ReadPackedPrimitiveNoInline
static bool ReadPackedPrimitiveNoInline(io::CodedInputStream *input, RepeatedField< CType > *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1255
google::protobuf.internal::WireFormatLite::UInt64Size
static size_t UInt64Size(uint64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1754
RepeatedField
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:403
google::protobuf.internal::WireFormatLite::Int64SizePlusOne
static size_t Int64SizePlusOne(int64_t value)
Definition: protobuf/src/google/protobuf/wire_format_lite.h:1778
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:54