cpp_primitive_field.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
40 
41 
42 namespace google {
43 namespace protobuf {
44 namespace compiler {
45 namespace cpp {
46 
47 using internal::WireFormatLite;
48 
49 namespace {
50 
51 // For encodings with fixed sizes, returns that size in bytes. Otherwise
52 // returns -1.
54  switch (type) {
56  return -1;
58  return -1;
60  return -1;
62  return -1;
64  return -1;
66  return -1;
79 
83  return -1;
84 
86  return -1;
88  return -1;
90  return -1;
92  return -1;
93 
94  // No default because we want the compiler to complain if any new
95  // types are added.
96  }
97  GOOGLE_LOG(FATAL) << "Can't get here.";
98  return -1;
99 }
100 
101 void SetPrimitiveVariables(const FieldDescriptor* descriptor,
102  std::map<std::string, std::string>* variables,
103  const Options& options) {
105  (*variables)["type"] = PrimitiveTypeName(options, descriptor->cpp_type());
106  (*variables)["default"] = DefaultValue(options, descriptor);
107  (*variables)["tag"] = StrCat(internal::WireFormat::MakeTag(descriptor));
108  int fixed_size = FixedSize(descriptor->type());
109  if (fixed_size != -1) {
110  (*variables)["fixed_size"] = StrCat(fixed_size);
111  }
112  (*variables)["wire_format_field_type"] = FieldDescriptorProto_Type_Name(
113  static_cast<FieldDescriptorProto_Type>(descriptor->type()));
114  (*variables)["full_name"] = descriptor->full_name();
115 }
116 
117 } // namespace
118 
119 // ===================================================================
120 
122  const FieldDescriptor* descriptor, const Options& options)
124  SetPrimitiveVariables(descriptor, &variables_, options);
125 }
126 
128 
130  io::Printer* printer) const {
131  Formatter format(printer, variables_);
132  format("$type$ $name$_;\n");
133 }
134 
136  io::Printer* printer) const {
137  Formatter format(printer, variables_);
138  format(
139  "$deprecated_attr$$type$ ${1$$name$$}$() const;\n"
140  "$deprecated_attr$void ${1$set_$name$$}$($type$ value);\n",
141  descriptor_);
142 }
143 
145  io::Printer* printer) const {
146  Formatter format(printer, variables_);
147  format(
148  "inline $type$ $classname$::$name$() const {\n"
149  " // @@protoc_insertion_point(field_get:$full_name$)\n"
150  " return $name$_;\n"
151  "}\n"
152  "inline void $classname$::set_$name$($type$ value) {\n"
153  " $set_hasbit$\n"
154  " $name$_ = value;\n"
155  " // @@protoc_insertion_point(field_set:$full_name$)\n"
156  "}\n");
157 }
158 
160  Formatter format(printer, variables_);
161  format("$name$_ = $default$;\n");
162 }
163 
165  Formatter format(printer, variables_);
166  format("set_$name$(from.$name$());\n");
167 }
168 
170  Formatter format(printer, variables_);
171  format("swap($name$_, other->$name$_);\n");
172 }
173 
175  io::Printer* printer) const {
176  Formatter format(printer, variables_);
177  format("$name$_ = $default$;\n");
178 }
179 
181  io::Printer* printer) const {
182  Formatter format(printer, variables_);
183  format("$name$_ = from.$name$_;\n");
184 }
185 
187  io::Printer* printer) const {
188  Formatter format(printer, variables_);
189  format(
190  "$set_hasbit_io$\n"
191  "DO_((::$proto_ns$::internal::WireFormatLite::ReadPrimitive<\n"
192  " $type$, "
193  "::$proto_ns$::internal::WireFormatLite::$wire_format_field_type$>(\n"
194  " input, &$name$_)));\n");
195 }
196 
198  io::Printer* printer) const {
199  Formatter format(printer, variables_);
200  format(
201  "::$proto_ns$::internal::WireFormatLite::Write$declared_type$("
202  "$number$, this->$name$(), output);\n");
203 }
204 
206  io::Printer* printer) const {
207  Formatter format(printer, variables_);
208  format(
209  "target = "
210  "::$proto_ns$::internal::WireFormatLite::Write$declared_type$ToArray("
211  "$number$, this->$name$(), target);\n");
212 }
213 
215  Formatter format(printer, variables_);
216  int fixed_size = FixedSize(descriptor_->type());
217  if (fixed_size == -1) {
218  format(
219  "total_size += $tag_size$ +\n"
220  " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n"
221  " this->$name$());\n");
222  } else {
223  format("total_size += $tag_size$ + $fixed_size$;\n");
224  }
225 }
226 
227 // ===================================================================
228 
230  const FieldDescriptor* descriptor, const Options& options)
233 }
234 
236 
238  io::Printer* printer) const {
239  Formatter format(printer, variables_);
240  format(
241  "inline $type$ $classname$::$name$() const {\n"
242  " // @@protoc_insertion_point(field_get:$full_name$)\n"
243  " if (has_$name$()) {\n"
244  " return $field_member$;\n"
245  " }\n"
246  " return $default$;\n"
247  "}\n"
248  "inline void $classname$::set_$name$($type$ value) {\n"
249  " if (!has_$name$()) {\n"
250  " clear_$oneof_name$();\n"
251  " set_has_$name$();\n"
252  " }\n"
253  " $field_member$ = value;\n"
254  " // @@protoc_insertion_point(field_set:$full_name$)\n"
255  "}\n");
256 }
257 
259  io::Printer* printer) const {
260  Formatter format(printer, variables_);
261  format("$field_member$ = $default$;\n");
262 }
263 
265  io::Printer* printer) const {
266  // Don't print any swapping code. Swapping the union will swap this field.
267 }
268 
270  io::Printer* printer) const {
271  Formatter format(printer, variables_);
272  format("$ns$::_$classname$_default_instance_.$name$_ = $default$;\n");
273 }
274 
276  io::Printer* printer) const {
277  Formatter format(printer, variables_);
278  format(
279  "clear_$oneof_name$();\n"
280  "DO_((::$proto_ns$::internal::WireFormatLite::ReadPrimitive<\n"
281  " $type$, "
282  "::$proto_ns$::internal::WireFormatLite::$wire_format_field_type$>(\n"
283  " input, &$field_member$)));\n"
284  "set_has_$name$();\n");
285 }
286 
287 // ===================================================================
288 
290  const FieldDescriptor* descriptor, const Options& options)
292  SetPrimitiveVariables(descriptor, &variables_, options);
293 
294  if (descriptor->is_packed()) {
295  variables_["packed_reader"] = "ReadPackedPrimitive";
296  variables_["repeated_reader"] = "ReadRepeatedPrimitiveNoInline";
297  } else {
298  variables_["packed_reader"] = "ReadPackedPrimitiveNoInline";
299  variables_["repeated_reader"] = "ReadRepeatedPrimitive";
300  }
301 }
302 
304 
306  io::Printer* printer) const {
307  Formatter format(printer, variables_);
308  format("::$proto_ns$::RepeatedField< $type$ > $name$_;\n");
309  if (descriptor_->is_packed() &&
311  format("mutable std::atomic<int> _$name$_cached_byte_size_;\n");
312  }
313 }
314 
316  io::Printer* printer) const {
317  Formatter format(printer, variables_);
318  format(
319  "$deprecated_attr$$type$ ${1$$name$$}$(int index) const;\n"
320  "$deprecated_attr$void ${1$set_$name$$}$(int index, $type$ value);\n"
321  "$deprecated_attr$void ${1$add_$name$$}$($type$ value);\n"
322  "$deprecated_attr$const ::$proto_ns$::RepeatedField< $type$ >&\n"
323  " ${1$$name$$}$() const;\n"
324  "$deprecated_attr$::$proto_ns$::RepeatedField< $type$ >*\n"
325  " ${1$mutable_$name$$}$();\n",
326  descriptor_);
327 }
328 
330  io::Printer* printer) const {
331  Formatter format(printer, variables_);
332  format(
333  "inline $type$ $classname$::$name$(int index) const {\n"
334  " // @@protoc_insertion_point(field_get:$full_name$)\n"
335  " return $name$_.Get(index);\n"
336  "}\n"
337  "inline void $classname$::set_$name$(int index, $type$ value) {\n"
338  " $name$_.Set(index, value);\n"
339  " // @@protoc_insertion_point(field_set:$full_name$)\n"
340  "}\n"
341  "inline void $classname$::add_$name$($type$ value) {\n"
342  " $name$_.Add(value);\n"
343  " // @@protoc_insertion_point(field_add:$full_name$)\n"
344  "}\n"
345  "inline const ::$proto_ns$::RepeatedField< $type$ >&\n"
346  "$classname$::$name$() const {\n"
347  " // @@protoc_insertion_point(field_list:$full_name$)\n"
348  " return $name$_;\n"
349  "}\n"
350  "inline ::$proto_ns$::RepeatedField< $type$ >*\n"
351  "$classname$::mutable_$name$() {\n"
352  " // @@protoc_insertion_point(field_mutable_list:$full_name$)\n"
353  " return &$name$_;\n"
354  "}\n");
355 }
356 
358  io::Printer* printer) const {
359  Formatter format(printer, variables_);
360  format("$name$_.Clear();\n");
361 }
362 
364  io::Printer* printer) const {
365  Formatter format(printer, variables_);
366  format("$name$_.MergeFrom(from.$name$_);\n");
367 }
368 
370  io::Printer* printer) const {
371  Formatter format(printer, variables_);
372  format("$name$_.InternalSwap(&other->$name$_);\n");
373 }
374 
376  io::Printer* printer) const {
377  // Not needed for repeated fields.
378 }
379 
381  io::Printer* printer) const {
382  Formatter format(printer, variables_);
383  format("$name$_.CopyFrom(from.$name$_);\n");
384 }
385 
387  io::Printer* printer) const {
388  Formatter format(printer, variables_);
389  format(
390  "DO_((::$proto_ns$::internal::WireFormatLite::$repeated_reader$<\n"
391  " $type$, "
392  "::$proto_ns$::internal::WireFormatLite::$wire_format_field_type$>(\n"
393  " $tag_size$, $tag$u, input, this->mutable_$name$())));\n");
394 }
395 
397  io::Printer* printer) const {
398  Formatter format(printer, variables_);
399  format(
400  "DO_((::$proto_ns$::internal::WireFormatLite::$packed_reader$<\n"
401  " $type$, "
402  "::$proto_ns$::internal::WireFormatLite::$wire_format_field_type$>(\n"
403  " input, this->mutable_$name$())));\n");
404 }
405 
407  io::Printer* printer) const {
408  Formatter format(printer, variables_);
409  bool array_written = false;
410  if (descriptor_->is_packed()) {
411  // Write the tag and the size.
412  format(
413  "if (this->$name$_size() > 0) {\n"
414  " ::$proto_ns$::internal::WireFormatLite::WriteTag("
415  "$number$, "
416  "::$proto_ns$::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, "
417  "output);\n"
418  " output->WriteVarint32(_$name$_cached_byte_size_.load(\n"
419  " std::memory_order_relaxed));\n");
420 
421  if (FixedSize(descriptor_->type()) > 0) {
422  // TODO(ckennelly): Use RepeatedField<T>::unsafe_data() via
423  // WireFormatLite to access the contents of this->$name$_ to save a branch
424  // here.
425  format(
426  " "
427  "::$proto_ns$::internal::WireFormatLite::Write$declared_type$Array(\n"
428  " this->$name$().data(), this->$name$_size(), output);\n");
429  array_written = true; // Wrote array all at once
430  }
431  format("}\n");
432  }
433  if (!array_written) {
434  format("for (int i = 0, n = this->$name$_size(); i < n; i++) {\n");
435  if (descriptor_->is_packed()) {
436  format(
437  " "
438  "::$proto_ns$::internal::WireFormatLite::Write$declared_type$NoTag(\n"
439  " this->$name$(i), output);\n");
440  } else {
441  format(
442  " ::$proto_ns$::internal::WireFormatLite::Write$declared_type$(\n"
443  " $number$, this->$name$(i), output);\n");
444  }
445  format("}\n");
446  }
447 }
448 
450  io::Printer* printer) const {
451  Formatter format(printer, variables_);
452  if (descriptor_->is_packed()) {
453  // Write the tag and the size.
454  format(
455  "if (this->$name$_size() > 0) {\n"
456  " target = ::$proto_ns$::internal::WireFormatLite::WriteTagToArray(\n"
457  " $number$,\n"
458  " "
459  "::$proto_ns$::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n"
460  " target);\n"
461  " target = "
462  "::$proto_ns$::io::CodedOutputStream::WriteVarint32ToArray(\n"
463  " _$name$_cached_byte_size_.load(std::memory_order_relaxed),\n"
464  " target);\n"
465  " target = ::$proto_ns$::internal::WireFormatLite::\n"
466  " Write$declared_type$NoTagToArray(this->$name$_, target);\n"
467  "}\n");
468  } else {
469  format(
470  "target = ::$proto_ns$::internal::WireFormatLite::\n"
471  " Write$declared_type$ToArray($number$, this->$name$_, target);\n");
472  }
473 }
474 
476  io::Printer* printer) const {
477  Formatter format(printer, variables_);
478  format("{\n");
479  format.Indent();
480  int fixed_size = FixedSize(descriptor_->type());
481  if (fixed_size == -1) {
482  format(
483  "size_t data_size = ::$proto_ns$::internal::WireFormatLite::\n"
484  " $declared_type$Size(this->$name$_);\n");
485  } else {
486  format(
487  "unsigned int count = static_cast<unsigned int>(this->$name$_size());\n"
488  "size_t data_size = $fixed_size$UL * count;\n");
489  }
490 
491  if (descriptor_->is_packed()) {
492  format(
493  "if (data_size > 0) {\n"
494  " total_size += $tag_size$ +\n"
495  " ::$proto_ns$::internal::WireFormatLite::Int32Size(\n"
496  " static_cast<$int32$>(data_size));\n"
497  "}\n"
498  "int cached_size = ::$proto_ns$::internal::ToCachedSize(data_size);\n"
499  "_$name$_cached_byte_size_.store(cached_size,\n"
500  " std::memory_order_relaxed);\n"
501  "total_size += data_size;\n");
502  } else {
503  format(
504  "total_size += $tag_size$ *\n"
505  " "
506  "::$proto_ns$::internal::FromIntSize(this->$name$_size());\n"
507  "total_size += data_size;\n");
508  }
509  format.Outdent();
510  format("}\n");
511 }
512 
513 } // namespace cpp
514 } // namespace compiler
515 } // namespace protobuf
516 } // namespace google
google::protobuf::FieldDescriptor::Type
Type
Definition: src/google/protobuf/descriptor.h:521
google::protobuf.internal::WireFormatLite::kFixed64Size
static const size_t kFixed64Size
Definition: wire_format_lite.h:673
google::protobuf::FieldDescriptor::TYPE_SINT64
@ TYPE_SINT64
Definition: src/google/protobuf/descriptor.h:544
google::protobuf::compiler::cpp::HasGeneratedMethods
bool HasGeneratedMethods(const FileDescriptor *file, const Options &options)
Definition: cpp_helpers.h:359
google::protobuf::FieldDescriptor
Definition: src/google/protobuf/descriptor.h:515
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateCopyConstructorCode
void GenerateCopyConstructorCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:180
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateSwappingCode
void GenerateSwappingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:369
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::PrimitiveOneofFieldGenerator
PrimitiveOneofFieldGenerator(const FieldDescriptor *descriptor, const Options &options)
Definition: cpp_primitive_field.cc:229
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::GenerateMergeFromCodedStream
void GenerateMergeFromCodedStream(io::Printer *printer) const
Definition: cpp_primitive_field.cc:275
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: strutil.cc:1480
google::protobuf::FieldDescriptor::TYPE_SINT32
@ TYPE_SINT32
Definition: src/google/protobuf/descriptor.h:543
options
Message * options
Definition: src/google/protobuf/descriptor.cc:3119
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateConstructorCode
void GenerateConstructorCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:174
FATAL
const int FATAL
Definition: log_severity.h:60
google::protobuf::FieldDescriptor::TYPE_BYTES
@ TYPE_BYTES
Definition: src/google/protobuf/descriptor.h:538
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateSerializeWithCachedSizesToArray
void GenerateSerializeWithCachedSizesToArray(io::Printer *printer) const
Definition: cpp_primitive_field.cc:449
google::protobuf::compiler::cpp::SetCommonFieldVariables
void SetCommonFieldVariables(const FieldDescriptor *descriptor, std::map< std::string, std::string > *variables, const Options &options)
Definition: cpp_field.cc:59
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::~PrimitiveFieldGenerator
~PrimitiveFieldGenerator()
Definition: cpp_primitive_field.cc:127
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateByteSize
void GenerateByteSize(io::Printer *printer) const
Definition: cpp_primitive_field.cc:475
google::protobuf.internal::WireFormatLite::kBoolSize
static const size_t kBoolSize
Definition: wire_format_lite.h:678
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateSwappingCode
void GenerateSwappingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:169
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateSerializeWithCachedSizes
void GenerateSerializeWithCachedSizes(io::Printer *printer) const
Definition: cpp_primitive_field.cc:197
google::protobuf.internal::WireFormat::MakeTag
static uint32 MakeTag(const FieldDescriptor *field)
Definition: wire_format.h:289
google::protobuf::compiler::cpp::FieldGenerator::options_
const Options & options_
Definition: cpp_field.h:206
descriptor
Descriptor * descriptor
Definition: php/ext/google/protobuf/protobuf.h:936
google::protobuf.internal::WireFormatLite::kDoubleSize
static const size_t kDoubleSize
Definition: wire_format_lite.h:677
FieldDescriptorProto_Type
FieldDescriptorProto_Type
Definition: descriptor.pb.h:172
google::protobuf::compiler::cpp::FieldGenerator::descriptor_
const FieldDescriptor * descriptor_
Definition: cpp_field.h:205
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateInlineAccessorDefinitions
void GenerateInlineAccessorDefinitions(io::Printer *printer) const
Definition: cpp_primitive_field.cc:144
google::protobuf::FieldDescriptor::is_packed
bool is_packed() const
Definition: src/google/protobuf/descriptor.cc:2983
cpp_helpers.h
google::protobuf::compiler::cpp::FieldGenerator::variables_
std::map< std::string, std::string > variables_
Definition: cpp_field.h:207
FieldDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:129
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::GenerateSwappingCode
void GenerateSwappingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:264
google::protobuf::compiler::cpp::FieldGenerator
Definition: cpp_field.h:71
strutil.h
google::protobuf::FieldDescriptor::TYPE_UINT32
@ TYPE_UINT32
Definition: src/google/protobuf/descriptor.h:539
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::GenerateClearingCode
void GenerateClearingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:258
google::protobuf::FieldDescriptor::file
const FileDescriptor * file() const
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GeneratePrivateMembers
void GeneratePrivateMembers(io::Printer *printer) const
Definition: cpp_primitive_field.cc:129
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateSerializeWithCachedSizes
void GenerateSerializeWithCachedSizes(io::Printer *printer) const
Definition: cpp_primitive_field.cc:406
format
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:2773
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateClearingCode
void GenerateClearingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:159
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateAccessorDeclarations
void GenerateAccessorDeclarations(io::Printer *printer) const
Definition: cpp_primitive_field.cc:135
printer.h
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: logging.h:146
google::protobuf::FieldDescriptor::TYPE_BOOL
@ TYPE_BOOL
Definition: src/google/protobuf/descriptor.h:533
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateSerializeWithCachedSizesToArray
void GenerateSerializeWithCachedSizesToArray(io::Printer *printer) const
Definition: cpp_primitive_field.cc:205
google::protobuf::compiler::cpp::DefaultValue
std::string DefaultValue(const FieldDescriptor *field)
Definition: cpp_helpers.cc:616
google::protobuf::FieldDescriptor::TYPE_STRING
@ TYPE_STRING
Definition: src/google/protobuf/descriptor.h:534
google::protobuf::compiler::java::FixedSize
int FixedSize(FieldDescriptor::Type type)
Definition: java_helpers.cc:776
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateMergeFromCodedStream
void GenerateMergeFromCodedStream(io::Printer *printer) const
Definition: cpp_primitive_field.cc:386
cpp
Definition: third_party/googletest/googlemock/scripts/generator/cpp/__init__.py:1
google::protobuf::compiler::cpp::Options
Definition: cpp_options.h:52
google::protobuf::compiler::cpp::PrimitiveFieldGenerator
Definition: cpp_primitive_field.h:47
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::PrimitiveFieldGenerator
PrimitiveFieldGenerator(const FieldDescriptor *descriptor, const Options &options)
Definition: cpp_primitive_field.cc:121
google::protobuf::io::Printer
Definition: printer.h:181
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator
RepeatedPrimitiveFieldGenerator(const FieldDescriptor *descriptor, const Options &options)
Definition: cpp_primitive_field.cc:289
google::protobuf::FieldDescriptor::TYPE_MESSAGE
@ TYPE_MESSAGE
Definition: src/google/protobuf/descriptor.h:536
google::protobuf::FieldDescriptor::TYPE_DOUBLE
@ TYPE_DOUBLE
Definition: src/google/protobuf/descriptor.h:522
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateConstructorCode
void GenerateConstructorCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:375
google::protobuf.internal::WireFormatLite::kSFixed32Size
static const size_t kSFixed32Size
Definition: wire_format_lite.h:674
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::~RepeatedPrimitiveFieldGenerator
~RepeatedPrimitiveFieldGenerator()
Definition: cpp_primitive_field.cc:303
type
GLenum type
Definition: glcorearb.h:2695
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateMergeFromCodedStream
void GenerateMergeFromCodedStream(io::Printer *printer) const
Definition: cpp_primitive_field.cc:186
google::protobuf::FieldDescriptor::TYPE_INT32
@ TYPE_INT32
Definition: src/google/protobuf/descriptor.h:528
google::protobuf::FieldDescriptor::TYPE_FLOAT
@ TYPE_FLOAT
Definition: src/google/protobuf/descriptor.h:523
cpp_primitive_field.h
google::protobuf::FieldDescriptor::type
Type type() const
Definition: src/google/protobuf/descriptor.h:2052
google::protobuf::FieldDescriptor::TYPE_FIXED64
@ TYPE_FIXED64
Definition: src/google/protobuf/descriptor.h:531
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::GenerateInlineAccessorDefinitions
void GenerateInlineAccessorDefinitions(io::Printer *printer) const
Definition: cpp_primitive_field.cc:237
wire_format.h
google::protobuf::FieldDescriptor::TYPE_GROUP
@ TYPE_GROUP
Definition: src/google/protobuf/descriptor.h:535
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateAccessorDeclarations
void GenerateAccessorDeclarations(io::Printer *printer) const
Definition: cpp_primitive_field.cc:315
google::protobuf::FieldDescriptor::TYPE_SFIXED32
@ TYPE_SFIXED32
Definition: src/google/protobuf/descriptor.h:541
google::protobuf::compiler::cpp::PrimitiveTypeName
const char * PrimitiveTypeName(FieldDescriptor::CppType type)
Definition: cpp_helpers.cc:482
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateInlineAccessorDefinitions
void GenerateInlineAccessorDefinitions(io::Printer *printer) const
Definition: cpp_primitive_field.cc:329
google::protobuf::FieldDescriptor::TYPE_UINT64
@ TYPE_UINT64
Definition: src/google/protobuf/descriptor.h:527
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateMergingCode
void GenerateMergingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:164
google::protobuf::compiler::cpp::PrimitiveFieldGenerator::GenerateByteSize
void GenerateByteSize(io::Printer *printer) const
Definition: cpp_primitive_field.cc:214
google::protobuf.internal::WireFormatLite::kFloatSize
static const size_t kFloatSize
Definition: wire_format_lite.h:676
google::protobuf::FieldDescriptor::TYPE_INT64
@ TYPE_INT64
Definition: src/google/protobuf/descriptor.h:524
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateMergeFromCodedStreamWithPacking
void GenerateMergeFromCodedStreamWithPacking(io::Printer *printer) const
Definition: cpp_primitive_field.cc:396
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateCopyConstructorCode
void GenerateCopyConstructorCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:380
google::protobuf.internal::WireFormatLite::kFixed32Size
static const size_t kFixed32Size
Definition: wire_format_lite.h:672
FieldDescriptorProto_Type_Name
const std::string & FieldDescriptorProto_Type_Name(T enum_t_value)
Definition: descriptor.pb.h:199
google::protobuf::FieldDescriptor::TYPE_ENUM
@ TYPE_ENUM
Definition: src/google/protobuf/descriptor.h:540
google::protobuf::FieldDescriptor::TYPE_SFIXED64
@ TYPE_SFIXED64
Definition: src/google/protobuf/descriptor.h:542
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::GenerateConstructorCode
void GenerateConstructorCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:269
google::protobuf.internal::WireFormatLite::kSFixed64Size
static const size_t kSFixed64Size
Definition: wire_format_lite.h:675
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateMergingCode
void GenerateMergingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:363
compiler
Definition: plugin.pb.cc:22
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GenerateClearingCode
void GenerateClearingCode(io::Printer *printer) const
Definition: cpp_primitive_field.cc:357
google::protobuf::compiler::cpp::Formatter
Definition: cpp_helpers.h:637
google::protobuf::compiler::cpp::PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator
~PrimitiveOneofFieldGenerator()
Definition: cpp_primitive_field.cc:235
google::protobuf::FieldDescriptor::TYPE_FIXED32
@ TYPE_FIXED32
Definition: src/google/protobuf/descriptor.h:532
google::protobuf::compiler::cpp::RepeatedPrimitiveFieldGenerator::GeneratePrivateMembers
void GeneratePrivateMembers(io::Printer *printer) const
Definition: cpp_primitive_field.cc:305
google::protobuf::compiler::cpp::SetCommonOneofFieldVariables
void SetCommonOneofFieldVariables(const FieldDescriptor *descriptor, std::map< std::string, std::string > *variables)
Definition: cpp_field.cc:105


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