message_lite.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Authors: wink@google.com (Wink Saville),
32 // kenton@google.com (Kenton Varda)
33 // Based on original Protocol Buffers design by
34 // Sanjay Ghemawat, Jeff Dean, and others.
35 
37 
38 #include <climits>
39 #include <cstdint>
40 #include <string>
41 
50 #include <google/protobuf/arena.h>
54 
57 
58 #include <google/protobuf/port_def.inc>
59 
60 namespace google {
61 namespace protobuf {
62 
64  return "(cannot determine missing fields for lite message)";
65 }
66 
68  std::uintptr_t address = reinterpret_cast<std::uintptr_t>(this);
69  return StrCat("MessageLite at 0x", strings::Hex(address));
70 }
71 
72 namespace {
73 
74 // When serializing, we first compute the byte size, then serialize the message.
75 // If serialization produces a different number of bytes than expected, we
76 // call this function, which crashes. The problem could be due to a bug in the
77 // protobuf implementation but is more likely caused by concurrent modification
78 // of the message. This function attempts to distinguish between the two and
79 // provide a useful error message.
80 void ByteSizeConsistencyError(size_t byte_size_before_serialization,
81  size_t byte_size_after_serialization,
82  size_t bytes_produced_by_serialization,
83  const MessageLite& message) {
84  GOOGLE_CHECK_EQ(byte_size_before_serialization, byte_size_after_serialization)
85  << message.GetTypeName()
86  << " was modified concurrently during serialization.";
87  GOOGLE_CHECK_EQ(bytes_produced_by_serialization, byte_size_before_serialization)
88  << "Byte size calculation and serialization were inconsistent. This "
89  "may indicate a bug in protocol buffers or it may be caused by "
90  "concurrent modification of "
91  << message.GetTypeName() << ".";
92  GOOGLE_LOG(FATAL) << "This shouldn't be called if all the sizes are equal.";
93 }
94 
95 std::string InitializationErrorMessage(const char* action,
96  const MessageLite& message) {
97  // Note: We want to avoid depending on strutil in the lite library, otherwise
98  // we'd use:
99  //
100  // return strings::Substitute(
101  // "Can't $0 message of type \"$1\" because it is missing required "
102  // "fields: $2",
103  // action, message.GetTypeName(),
104  // message.InitializationErrorString());
105 
106  std::string result;
107  result += "Can't ";
108  result += action;
109  result += " message of type \"";
110  result += message.GetTypeName();
111  result += "\" because it is missing required fields: ";
112  result += message.InitializationErrorString();
113  return result;
114 }
115 
116 inline StringPiece as_string_view(const void* data, int size) {
117  return StringPiece(static_cast<const char*>(data), size);
118 }
119 
120 } // namespace
121 
123  GOOGLE_LOG(ERROR) << InitializationErrorMessage("parse", *this);
124 }
125 
126 namespace internal {
127 
128 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
129 
130 template <bool aliasing>
132  const char* ptr;
134  aliasing, &ptr, input);
135  ptr = msg->_InternalParse(ptr, &ctx);
136  // ctx has an explicit limit set (length of string_view).
137  return ptr && ctx.EndedAtLimit();
138 }
139 
140 template <bool aliasing>
141 bool MergePartialFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg) {
142  const char* ptr;
143  internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(),
144  aliasing, &ptr, input);
145  ptr = msg->_InternalParse(ptr, &ctx);
146  // ctx has no explicit limit (hence we end on end of stream)
147  return ptr && ctx.EndedAtEndOfStream();
148 }
149 
150 template <bool aliasing>
151 bool MergePartialFromImpl(BoundedZCIS input, MessageLite* msg) {
152  const char* ptr;
153  internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(),
154  aliasing, &ptr, input.zcis, input.limit);
155  ptr = msg->_InternalParse(ptr, &ctx);
156  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
157  ctx.BackUp(ptr);
158  return ctx.EndedAtLimit();
159 }
160 
161 #else // !GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
162 
165  bool aliasing) {
166  return message->MergePartialFromCodedStream(cis) &&
167  cis->ConsumedEntireMessage();
168 }
169 
170 template <bool aliasing>
172  io::CodedInputStream decoder(reinterpret_cast<const uint8*>(input.data()),
173  input.size());
174  return InlineMergePartialEntireStream(&decoder, msg, aliasing);
175 }
176 
177 template <bool aliasing>
180  decoder.PushLimit(input.limit);
181  return InlineMergePartialEntireStream(&decoder, msg, aliasing) &&
182  decoder.BytesUntilLimit() == 0;
183 }
184 
185 template <bool aliasing>
188  return InlineMergePartialEntireStream(&decoder, msg, aliasing);
189 }
190 
191 #endif // !GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
192 
194  MessageLite* msg);
196  MessageLite* msg);
198  MessageLite* msg);
200  MessageLite* msg);
201 template bool MergePartialFromImpl<false>(BoundedZCIS input, MessageLite* msg);
202 template bool MergePartialFromImpl<true>(BoundedZCIS input, MessageLite* msg);
203 
204 } // namespace internal
205 
206 MessageLite* MessageLite::New(Arena* arena) const {
207  MessageLite* message = New();
208  if (arena != NULL) {
209  arena->Own(message);
210  }
211  return message;
212 }
213 
214 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
215 class ZeroCopyCodedInputStream : public io::ZeroCopyInputStream {
216  public:
217  ZeroCopyCodedInputStream(io::CodedInputStream* cis) : cis_(cis) {}
218  bool Next(const void** data, int* size) final {
219  if (!cis_->GetDirectBufferPointer(data, size)) return false;
220  cis_->Skip(*size);
221  return true;
222  }
223  void BackUp(int count) final { cis_->Advance(-count); }
224  bool Skip(int count) final { return cis_->Skip(count); }
225  int64 ByteCount() const final { return 0; }
226 
227  bool aliasing_enabled() { return cis_->aliasing_enabled_; }
228 
229  private:
230  io::CodedInputStream* cis_;
231 };
232 
233 bool MessageLite::MergePartialFromCodedStream(io::CodedInputStream* input) {
234  ZeroCopyCodedInputStream zcis(input);
235  const char* ptr;
236  internal::ParseContext ctx(input->RecursionBudget(), zcis.aliasing_enabled(),
237  &ptr, &zcis);
238  // MergePartialFromCodedStream allows terminating the wireformat by 0 or
239  // end-group tag. Leaving it up to the caller to verify correct ending by
240  // calling LastTagWas on input. We need to maintain this behavior.
241  ctx.TrackCorrectEnding();
242  ctx.data().pool = input->GetExtensionPool();
243  ctx.data().factory = input->GetExtensionFactory();
244  ptr = _InternalParse(ptr, &ctx);
245  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
246  ctx.BackUp(ptr);
247  if (!ctx.EndedAtEndOfStream()) {
248  GOOGLE_DCHECK(ctx.LastTag() != 1); // We can't end on a pushed limit.
249  if (ctx.IsExceedingLimit(ptr)) return false;
250  input->SetLastTag(ctx.LastTag());
251  return true;
252  }
253  input->SetConsumed();
254  return true;
255 }
256 #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
257 
260 }
261 
263  Clear();
264  return MergeFromCodedStream(input);
265 }
266 
268  Clear();
270 }
271 
273  return ParseFrom<kParse>(input);
274 }
275 
278  return ParseFrom<kParsePartial>(input);
279 }
280 
281 bool MessageLite::ParseFromFileDescriptor(int file_descriptor) {
282  io::FileInputStream input(file_descriptor);
283  return ParseFromZeroCopyStream(&input) && input.GetErrno() == 0;
284 }
285 
287  io::FileInputStream input(file_descriptor);
288  return ParsePartialFromZeroCopyStream(&input) && input.GetErrno() == 0;
289 }
290 
292  io::IstreamInputStream zero_copy_input(input);
293  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
294 }
295 
297  io::IstreamInputStream zero_copy_input(input);
298  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
299 }
300 
303  return ParseFrom<kMergePartial>(internal::BoundedZCIS{input, size});
304 }
305 
307  int size) {
308  return ParseFrom<kMerge>(internal::BoundedZCIS{input, size});
309 }
310 
312  int size) {
313  return ParseFrom<kParse>(internal::BoundedZCIS{input, size});
314 }
315 
318  return ParseFrom<kParsePartial>(internal::BoundedZCIS{input, size});
319 }
320 
322  return ParseFrom<kParse>(data);
323 }
324 
326  return ParseFrom<kParsePartial>(data);
327 }
328 
329 bool MessageLite::ParseFromArray(const void* data, int size) {
330  return ParseFrom<kParse>(as_string_view(data, size));
331 }
332 
334  return ParseFrom<kParsePartial>(as_string_view(data, size));
335 }
336 
338  return ParseFrom<kMerge>(data);
339 }
340 
341 
342 // ===================================================================
343 
346  static_cast<const internal::SerializationTable*>(InternalGetTable());
347  auto deterministic =
349  if (table) {
350  return internal::TableSerializeToArray(*this, table, deterministic, target);
351  } else {
352  if (deterministic) {
353  // We only optimize this when using optimize_for = SPEED. In other cases
354  // we just use the CodedOutputStream path.
355  int size = GetCachedSize();
357  io::CodedOutputStream coded_out(&out);
358  coded_out.SetSerializationDeterministic(true);
359  SerializeWithCachedSizes(&coded_out);
360  GOOGLE_CHECK(!coded_out.HadError());
361  return target + size;
362  } else {
364  }
365  }
366 }
367 
369  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
371 }
372 
374  io::CodedOutputStream* output) const {
375  const size_t size = ByteSizeLong(); // Force size to be cached.
376  if (size > INT_MAX) {
378  << " exceeded maximum protobuf size of 2GB: " << size;
379  return false;
380  }
381 
382  if (!output->IsSerializationDeterministic()) {
383  uint8* buffer = output->GetDirectBufferForNBytesAndAdvance(size);
384  if (buffer != nullptr) {
386  if (end - buffer != size) {
387  ByteSizeConsistencyError(size, ByteSizeLong(), end - buffer, *this);
388  }
389  return true;
390  }
391  }
392  int original_byte_count = output->ByteCount();
394  if (output->HadError()) {
395  return false;
396  }
397  int final_byte_count = output->ByteCount();
398 
399  if (final_byte_count - original_byte_count != size) {
400  ByteSizeConsistencyError(size, ByteSizeLong(),
401  final_byte_count - original_byte_count, *this);
402  }
403 
404  return true;
405 }
406 
411 }
412 
417 }
418 
419 bool MessageLite::SerializeToFileDescriptor(int file_descriptor) const {
420  io::FileOutputStream output(file_descriptor);
421  return SerializeToZeroCopyStream(&output) && output.Flush();
422 }
423 
424 bool MessageLite::SerializePartialToFileDescriptor(int file_descriptor) const {
425  io::FileOutputStream output(file_descriptor);
426  return SerializePartialToZeroCopyStream(&output) && output.Flush();
427 }
428 
429 bool MessageLite::SerializeToOstream(std::ostream* output) const {
430  {
431  io::OstreamOutputStream zero_copy_output(output);
432  if (!SerializeToZeroCopyStream(&zero_copy_output)) return false;
433  }
434  return output->good();
435 }
436 
438  io::OstreamOutputStream zero_copy_output(output);
439  return SerializePartialToZeroCopyStream(&zero_copy_output);
440 }
441 
443  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
445 }
446 
448  size_t old_size = output->size();
449  size_t byte_size = ByteSizeLong();
450  if (byte_size > INT_MAX) {
452  << " exceeded maximum protobuf size of 2GB: " << byte_size;
453  return false;
454  }
455 
456  STLStringResizeUninitialized(output, old_size + byte_size);
457  uint8* start =
458  reinterpret_cast<uint8*>(io::mutable_string_data(output) + old_size);
460  if (end - start != byte_size) {
461  ByteSizeConsistencyError(byte_size, ByteSizeLong(), end - start, *this);
462  }
463  return true;
464 }
465 
467  output->clear();
468  return AppendToString(output);
469 }
470 
472  output->clear();
474 }
475 
476 bool MessageLite::SerializeToArray(void* data, int size) const {
477  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
479 }
480 
482  const size_t byte_size = ByteSizeLong();
483  if (byte_size > INT_MAX) {
485  << " exceeded maximum protobuf size of 2GB: " << byte_size;
486  return false;
487  }
488  if (size < byte_size) return false;
489  uint8* start = reinterpret_cast<uint8*>(data);
491  if (end - start != byte_size) {
492  ByteSizeConsistencyError(byte_size, ByteSizeLong(), end - start, *this);
493  }
494  return true;
495 }
496 
498  // If the compiler implements the (Named) Return Value Optimization,
499  // the local variable 'output' will not actually reside on the stack
500  // of this function, but will be overlaid with the object that the
501  // caller supplied for the return value to be constructed in.
503  if (!AppendToString(&output)) output.clear();
504  return output;
505 }
506 
509  if (!AppendPartialToString(&output)) output.clear();
510  return output;
511 }
512 
514  io::CodedOutputStream* output) const {
517  *this,
518  static_cast<const internal::SerializationTable*>(InternalGetTable()),
519  output);
520 }
521 
522 
523 // The table driven code optimizes the case that the CodedOutputStream buffer
524 // is large enough to serialize into it directly.
525 // If the proto is optimized for speed, this method will be overridden by
526 // generated code for maximum speed. If the proto is optimized for size or
527 // is lite, then we need to specialize this to avoid infinite recursion.
529  uint8* target) const {
531  static_cast<const internal::SerializationTable*>(InternalGetTable());
532  if (table == NULL) {
533  // We only optimize this when using optimize_for = SPEED. In other cases
534  // we just use the CodedOutputStream path.
535  int size = GetCachedSize();
537  io::CodedOutputStream coded_out(&out);
538  SerializeWithCachedSizes(&coded_out);
539  GOOGLE_CHECK(!coded_out.HadError());
540  return target + size;
541  } else {
542  return internal::TableSerializeToArray(*this, table, false, target);
543  }
544 }
545 
546 namespace internal {
547 
548 template <>
550  const MessageLite* prototype, Arena* arena) {
551  return prototype->New(arena);
552 }
553 template <>
555  MessageLite* to) {
556  to->CheckTypeAndMergeFrom(from);
557 }
558 template <>
560  std::string* to) {
561  *to = from;
562 }
563 
564 } // namespace internal
565 
566 } // namespace protobuf
567 } // namespace google
table
upb_strtable table
Definition: php/ext/google/protobuf/protobuf.h:1065
zero_copy_stream.h
GOOGLE_CHECK_EQ
#define GOOGLE_CHECK_EQ(A, B)
Definition: logging.h:156
google::protobuf::MessageLite::GetTypeName
virtual std::string GetTypeName() const =0
benchmarks.python.py_benchmark.const
const
Definition: py_benchmark.py:14
google::protobuf::MessageLite::ParsePartialFromZeroCopyStream
bool ParsePartialFromZeroCopyStream(io::ZeroCopyInputStream *input)
Definition: message_lite.cc:276
zero_copy_stream_impl.h
end
GLuint GLuint end
Definition: glcorearb.h:2858
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
google::protobuf::MessageLite::MergePartialFromBoundedZeroCopyStream
bool MergePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: message_lite.cc:301
google::protobuf::MessageLite::GetCachedSize
virtual int GetCachedSize() const =0
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: strutil.cc:1480
google::protobuf::MessageLite::Clear
virtual void Clear()=0
google::protobuf::MessageLite::ParseFromFileDescriptor
bool ParseFromFileDescriptor(int file_descriptor)
Definition: message_lite.cc:281
input
std::string input
Definition: tokenizer_unittest.cc:197
google::protobuf::uint8
uint8_t uint8
Definition: protobuf/src/google/protobuf/stubs/port.h:153
google::protobuf::io::CodedOutputStream::HadError
bool HadError() const
Definition: coded_stream.h:829
FATAL
const int FATAL
Definition: log_severity.h:60
google::protobuf::MessageLite::ParseFromCodedStream
bool ParseFromCodedStream(io::CodedInputStream *input)
Definition: message_lite.cc:262
google::protobuf::io::mutable_string_data
char * mutable_string_data(std::string *s)
Definition: zero_copy_stream_impl_lite.h:383
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: logging.h:194
google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic
static bool IsDefaultSerializationDeterministic()
Definition: coded_stream.h:866
google::protobuf::MessageLite::SerializeToArray
bool SerializeToArray(void *data, int size) const
Definition: message_lite.cc:476
google::protobuf::MessageLite::AppendPartialToString
bool AppendPartialToString(std::string *output) const
Definition: message_lite.cc:447
google::protobuf::io::CodedInputStream::GetDefaultRecursionLimit
static int GetDefaultRecursionLimit()
Definition: coded_stream.h:416
google::protobuf.internal::ParseContext
Definition: parse_context.h:322
google::protobuf::MessageLite::ParsePartialFromCodedStream
bool ParsePartialFromCodedStream(io::CodedInputStream *input)
Definition: message_lite.cc:267
google::protobuf::MessageLite::SerializePartialToZeroCopyStream
bool SerializePartialToZeroCopyStream(io::ZeroCopyOutputStream *output) const
Definition: message_lite.cc:413
google::protobuf::MessageLite::ParsePartialFromIstream
bool ParsePartialFromIstream(std::istream *input)
Definition: message_lite.cc:296
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf::io::CodedOutputStream::SetSerializationDeterministic
void SetSerializationDeterministic(bool value)
Definition: coded_stream.h:855
encoder
static char encoder[85+1]
Definition: zmq_utils.cpp:72
google::protobuf::MessageLite
Definition: message_lite.h:183
target
GLenum target
Definition: glcorearb.h:3739
google::protobuf.internal.python_message._InternalParse
_InternalParse
Definition: python_message.py:1197
address
const char * address
Definition: builds/zos/test_fork.cpp:6
google::protobuf::MessageLite::LogInitializationErrorMessage
void LogInitializationErrorMessage() const
Definition: message_lite.cc:122
google::protobuf::MessageLite::InternalGetTable
virtual const void * InternalGetTable() const
Definition: message_lite.h:482
google::protobuf::MessageLite::MergeFromBoundedZeroCopyStream
bool MergeFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: message_lite.cc:306
google::protobuf::MessageLite::ParsePartialFromString
bool ParsePartialFromString(const std::string &data)
Definition: message_lite.cc:325
parse_context.h
google::protobuf::MessageLite::SerializeToZeroCopyStream
bool SerializeToZeroCopyStream(io::ZeroCopyOutputStream *output) const
Definition: message_lite.cc:407
google::protobuf::MessageLite::SerializeWithCachedSizes
virtual void SerializeWithCachedSizes(io::CodedOutputStream *output) const
Definition: message_lite.cc:513
google::protobuf::MessageLite::MergePartialFromCodedStream
virtual bool MergePartialFromCodedStream(io::CodedInputStream *input)=0
google::protobuf.internal::BoundedZCIS
Definition: message_lite.h:520
google::protobuf.internal::TableSerializeToArray
uint8 * TableSerializeToArray(const MessageLite &msg, const SerializationTable *table, bool is_deterministic, uint8 *buffer)
Definition: generated_message_table_driven.h:263
benchmarks.python.py_benchmark.action
action
Definition: py_benchmark.py:13
google::protobuf::MessageLite::ParsePartialFromFileDescriptor
bool ParsePartialFromFileDescriptor(int file_descriptor)
Definition: message_lite.cc:286
strutil.h
google::protobuf::MessageLite::ParseFromBoundedZeroCopyStream
bool ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: message_lite.cc:311
google::protobuf::io::CodedInputStream::ConsumedEntireMessage
bool ConsumedEntireMessage()
Definition: coded_stream.h:1072
coded_stream.h
google::protobuf.internal::MergePartialFromImpl< true >
template bool MergePartialFromImpl< true >(StringPiece input, MessageLite *msg)
google::protobuf::MessageLite::InitializationErrorString
virtual std::string InitializationErrorString() const
Definition: message_lite.cc:63
google::protobuf::StringPiece
Definition: stringpiece.h:180
start
GLuint start
Definition: glcorearb.h:2858
google::protobuf::MessageLite::MergeFromCodedStream
bool MergeFromCodedStream(io::CodedInputStream *input)
Definition: message_lite.cc:258
google::protobuf::io::OstreamOutputStream
Definition: zero_copy_stream_impl.h:258
google::protobuf::MessageLite::SerializePartialToFileDescriptor
bool SerializePartialToFileDescriptor(int file_descriptor) const
Definition: message_lite.cc:424
google::protobuf::MessageLite::SerializeToCodedStream
bool SerializeToCodedStream(io::CodedOutputStream *output) const
Definition: message_lite.cc:368
google::protobuf::MessageLite::ParseFromZeroCopyStream
bool ParseFromZeroCopyStream(io::ZeroCopyInputStream *input)
Definition: message_lite.cc:272
google::protobuf::io::ArrayOutputStream
Definition: zero_copy_stream_impl_lite.h:99
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: logging.h:146
google::protobuf::MessageLite::SerializeToString
bool SerializeToString(std::string *output) const
Definition: message_lite.cc:466
size
#define size
Definition: glcorearb.h:2944
repeated_field.h
google::protobuf::MessageLite::ParseFromArray
bool ParseFromArray(const void *data, int size)
Definition: message_lite.cc:329
google::protobuf::MessageLite::AppendToString
bool AppendToString(std::string *output) const
Definition: message_lite.cc:442
buffer
Definition: buffer_processor.h:43
generated_message_table_driven.h
google::protobuf::io::FileInputStream
Definition: zero_copy_stream_impl.h:64
google::protobuf.internal::MergePartialFromImpl
bool MergePartialFromImpl(StringPiece input, MessageLite *msg)
Definition: message_lite.cc:171
google::protobuf::io::IstreamInputStream
Definition: zero_copy_stream_impl.h:215
google::protobuf::MessageLite::SerializePartialToCodedStream
bool SerializePartialToCodedStream(io::CodedOutputStream *output) const
Definition: message_lite.cc:373
google::protobuf::ERROR
static const LogLevel ERROR
Definition: protobuf/src/google/protobuf/testing/googletest.h:70
google::protobuf::MessageLite::SerializePartialToOstream
bool SerializePartialToOstream(std::ostream *output) const
Definition: message_lite.cc:437
GOOGLE_CHECK
#define GOOGLE_CHECK(EXPRESSION)
Definition: logging.h:153
decoder
static uint8_t decoder[96]
Definition: zmq_utils.cpp:85
google::protobuf::MessageLite::SerializePartialToArray
bool SerializePartialToArray(void *data, int size) const
Definition: message_lite.cc:481
google::protobuf::io::CodedOutputStream
Definition: coded_stream.h:693
google::protobuf::MessageLite::SerializeWithCachedSizesToArray
virtual uint8 * SerializeWithCachedSizesToArray(uint8 *target) const
Definition: message_lite.cc:344
google::protobuf::io::ZeroCopyInputStream
Definition: zero_copy_stream.h:126
google::protobuf::io::FileOutputStream
Definition: zero_copy_stream_impl.h:141
zero_copy_stream_impl_lite.h
google::protobuf::MessageLite::SerializeToOstream
bool SerializeToOstream(std::ostream *output) const
Definition: message_lite.cc:429
google::protobuf.internal::InlineMergePartialEntireStream
bool InlineMergePartialEntireStream(io::CodedInputStream *cis, MessageLite *message, bool aliasing)
Definition: message_lite.cc:163
google::protobuf::MessageLite::ParsePartialFromBoundedZeroCopyStream
bool ParsePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: message_lite.cc:316
google::protobuf::MessageLite::ByteSizeLong
virtual size_t ByteSizeLong() const =0
common.h
google::protobuf::MessageLite::IsInitialized
virtual bool IsInitialized() const =0
google::protobuf.internal::SerializationTable
Definition: generated_message_table_driven.h:234
google::protobuf::MessageLite::SerializeToFileDescriptor
bool SerializeToFileDescriptor(int file_descriptor) const
Definition: message_lite.cc:419
google::protobuf::MessageLite::SerializePartialToString
bool SerializePartialToString(std::string *output) const
Definition: message_lite.cc:471
google::protobuf::MessageLite::SerializeAsString
std::string SerializeAsString() const
Definition: message_lite.cc:497
pump.Skip
def Skip(lines, pos, regex)
Definition: pump.py:261
google::protobuf::MessageLite::SerializePartialAsString
std::string SerializePartialAsString() const
Definition: message_lite.cc:507
size
GLsizeiptr size
Definition: glcorearb.h:2943
stl_util.h
arena.h
message_lite.h
google::protobuf::io::ZeroCopyOutputStream
Definition: zero_copy_stream.h:183
google::protobuf::MessageLite::InternalSerializeWithCachedSizesToArray
virtual uint8 * InternalSerializeWithCachedSizesToArray(uint8 *target) const
Definition: message_lite.cc:528
google::protobuf::io::CodedInputStream
Definition: coded_stream.h:173
stringprintf.h
logging.h
google::protobuf::MessageLite::ParseFromString
bool ParseFromString(const std::string &data)
Definition: message_lite.cc:321
google::protobuf.internal::TableSerialize
void TableSerialize(const MessageLite &msg, const SerializationTable *table, io::CodedOutputStream *output)
Definition: generated_message_table_driven.h:244
generated_message_util.h
google::protobuf.internal::MergePartialFromImpl< false >
template bool MergePartialFromImpl< false >(StringPiece input, MessageLite *msg)
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
google::protobuf::MessageLite::ParseFromIstream
bool ParseFromIstream(std::istream *input)
Definition: message_lite.cc:291
google::protobuf::MessageLite::MergeFromString
bool MergeFromString(const std::string &data)
Definition: message_lite.cc:337
internal
Definition: any.pb.h:40
google::protobuf::MessageLite::IsInitializedWithErrors
bool IsInitializedWithErrors() const
Definition: message_lite.h:493
google::protobuf.internal::GenericTypeHandler
Definition: arena.h:91
google::protobuf::MessageLite::DebugString
std::string DebugString() const
Definition: message_lite.cc:67
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
count
GLint GLsizei count
Definition: glcorearb.h:2830
google::protobuf::MessageLite::CheckTypeAndMergeFrom
virtual void CheckTypeAndMergeFrom(const MessageLite &other)=0
google::protobuf::STLStringResizeUninitialized
void STLStringResizeUninitialized(string *s, size_t new_size)
Definition: stl_util.h:67
google
Definition: data_proto2_to_proto3_util.h:11
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
google::protobuf::MessageLite::ParsePartialFromArray
bool ParsePartialFromArray(const void *data, int size)
Definition: message_lite.cc:333
google::protobuf.text_format.Merge
def Merge(text, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
Definition: text_format.py:656
google::protobuf::MessageLite::New
virtual MessageLite * New() const =0


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:56