objectivec_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 #include <iostream>
32 
42 
43 namespace google {
44 namespace protobuf {
45 namespace compiler {
46 namespace objectivec {
47 
48 namespace {
49 
51  std::map<string, string>* variables) {
52  string camel_case_name = FieldName(descriptor);
53  string raw_field_name;
54  if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
55  raw_field_name = descriptor->message_type()->name();
56  } else {
57  raw_field_name = descriptor->name();
58  }
59  // The logic here has to match -[GGPBFieldDescriptor textFormatName].
60  const string un_camel_case_name(
61  UnCamelCaseFieldName(camel_case_name, descriptor));
62  const bool needs_custom_name = (raw_field_name != un_camel_case_name);
63 
64  SourceLocation location;
65  if (descriptor->GetSourceLocation(&location)) {
66  (*variables)["comments"] = BuildCommentsString(location, true);
67  } else {
68  (*variables)["comments"] = "\n";
69  }
70  const string& classname = ClassName(descriptor->containing_type());
71  (*variables)["classname"] = classname;
72  (*variables)["name"] = camel_case_name;
73  const string& capitalized_name = FieldNameCapitalized(descriptor);
74  (*variables)["capitalized_name"] = capitalized_name;
75  (*variables)["raw_field_name"] = raw_field_name;
76  (*variables)["field_number_name"] =
77  classname + "_FieldNumber_" + capitalized_name;
78  (*variables)["field_number"] = StrCat(descriptor->number());
79  (*variables)["field_type"] = GetCapitalizedType(descriptor);
80  (*variables)["deprecated_attribute"] = GetOptionalDeprecatedAttribute(descriptor);
81  std::vector<string> field_flags;
82  if (descriptor->is_repeated()) field_flags.push_back("GPBFieldRepeated");
83  if (descriptor->is_required()) field_flags.push_back("GPBFieldRequired");
84  if (descriptor->is_optional()) field_flags.push_back("GPBFieldOptional");
85  if (descriptor->is_packed()) field_flags.push_back("GPBFieldPacked");
86 
87  // ObjC custom flags.
88  if (descriptor->has_default_value())
89  field_flags.push_back("GPBFieldHasDefaultValue");
90  if (needs_custom_name) field_flags.push_back("GPBFieldTextFormatNameCustom");
91  if (descriptor->type() == FieldDescriptor::TYPE_ENUM) {
92  field_flags.push_back("GPBFieldHasEnumDescriptor");
93  }
94 
95  (*variables)["fieldflags"] = BuildFlagsString(FLAGTYPE_FIELD, field_flags);
96 
97  (*variables)["default"] = DefaultValue(descriptor);
98  (*variables)["default_name"] = GPBGenericValueFieldName(descriptor);
99 
100  (*variables)["dataTypeSpecific_name"] = "className";
101  (*variables)["dataTypeSpecific_value"] = "NULL";
102 
103  (*variables)["storage_offset_value"] =
104  "(uint32_t)offsetof(" + classname + "__storage_, " + camel_case_name + ")";
105  (*variables)["storage_offset_comment"] = "";
106 
107  // Clear some common things so they can be set just when needed.
108  (*variables)["storage_attribute"] = "";
109 }
110 
111 } // namespace
112 
114  const Options& options) {
115  FieldGenerator* result = NULL;
116  if (field->is_repeated()) {
117  switch (GetObjectiveCType(field)) {
118  case OBJECTIVECTYPE_MESSAGE: {
119  if (field->is_map()) {
120  result = new MapFieldGenerator(field, options);
121  } else {
123  }
124  break;
125  }
126  case OBJECTIVECTYPE_ENUM:
128  break;
129  default:
131  break;
132  }
133  } else {
134  switch (GetObjectiveCType(field)) {
135  case OBJECTIVECTYPE_MESSAGE: {
136  result = new MessageFieldGenerator(field, options);
137  break;
138  }
139  case OBJECTIVECTYPE_ENUM:
140  result = new EnumFieldGenerator(field, options);
141  break;
142  default:
143  if (IsReferenceType(field)) {
145  } else {
146  result = new PrimitiveFieldGenerator(field, options);
147  }
148  break;
149  }
150  }
151  result->FinishInitialization();
152  return result;
153 }
154 
156  const Options& options)
159 }
160 
162 
164  printer->Print(
165  variables_,
166  "$field_number_name$ = $field_number$,\n");
167 }
168 
170  io::Printer* printer) const {
171  // Nothing
172 }
173 
175  io::Printer* printer) const {
176  // Nothing
177 }
178 
180  std::set<string>* fwd_decls) const {
181  // Nothing
182 }
183 
185  io::Printer* printer, bool include_default) const {
186  // Printed in the same order as the structure decl.
187  if (include_default) {
188  printer->Print(
189  variables_,
190  "{\n"
191  " .defaultValue.$default_name$ = $default$,\n"
192  " .core.name = \"$name$\",\n"
193  " .core.dataTypeSpecific.$dataTypeSpecific_name$ = $dataTypeSpecific_value$,\n"
194  " .core.number = $field_number_name$,\n"
195  " .core.hasIndex = $has_index$,\n"
196  " .core.offset = $storage_offset_value$,$storage_offset_comment$\n"
197  " .core.flags = $fieldflags$,\n"
198  " .core.dataType = GPBDataType$field_type$,\n"
199  "},\n");
200  } else {
201  printer->Print(
202  variables_,
203  "{\n"
204  " .name = \"$name$\",\n"
205  " .dataTypeSpecific.$dataTypeSpecific_name$ = $dataTypeSpecific_value$,\n"
206  " .number = $field_number_name$,\n"
207  " .hasIndex = $has_index$,\n"
208  " .offset = $storage_offset_value$,$storage_offset_comment$\n"
209  " .flags = $fieldflags$,\n"
210  " .dataType = GPBDataType$field_type$,\n"
211  "},\n");
212  }
213 }
214 
215 void FieldGenerator::SetRuntimeHasBit(int has_index) {
216  variables_["has_index"] = StrCat(has_index);
217 }
218 
220  variables_["has_index"] = "GPBNoHasBit";
221 }
222 
224  return 0;
225 }
226 
228  // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some
229  // error cases, so it seems to be ok to use as a back door for errors.
230  std::cerr << "Error: should have overridden SetExtraRuntimeHasBitsBase()." << std::endl;
231  std::cerr.flush();
232  abort();
233 }
234 
235 void FieldGenerator::SetOneofIndexBase(int index_base) {
236  if (descriptor_->containing_oneof() != NULL) {
237  int index = descriptor_->containing_oneof()->index() + index_base;
238  // Flip the sign to mark it as a oneof.
239  variables_["has_index"] = StrCat(-index);
240  }
241 }
242 
244  // If "property_type" wasn't set, make it "storage_type".
245  if ((variables_.find("property_type") == variables_.end()) &&
246  (variables_.find("storage_type") != variables_.end())) {
247  variables_["property_type"] = variable("storage_type");
248  }
249 }
250 
252  const Options& options)
254  // Nothing
255 }
256 
258 
260  io::Printer* printer) const {
261  printer->Print(variables_, "$storage_type$ $name$;\n");
262 }
263 
265  io::Printer* printer) const {
266  printer->Print(variables_, "$comments$");
267  printer->Print(
268  variables_,
269  "@property(nonatomic, readwrite) $property_type$ $name$$deprecated_attribute$;\n"
270  "\n");
271  if (WantsHasProperty()) {
272  printer->Print(
273  variables_,
274  "@property(nonatomic, readwrite) BOOL has$capitalized_name$$deprecated_attribute$;\n");
275  }
276 }
277 
279  io::Printer* printer) const {
280  if (WantsHasProperty()) {
281  printer->Print(variables_, "@dynamic has$capitalized_name$, $name$;\n");
282  } else {
283  printer->Print(variables_, "@dynamic $name$;\n");
284  }
285 }
286 
288  if (descriptor_->containing_oneof() != NULL) {
289  // If in a oneof, it uses the oneofcase instead of a has bit.
290  return false;
291  }
293  // In proto1/proto2, every field has a has_$name$() method.
294  return true;
295  }
296  return false;
297 }
298 
300  if (descriptor_->containing_oneof() != NULL) {
301  // The oneof tracks what is set instead.
302  return false;
303  }
304  return true;
305 }
306 
308  const Options& options)
310  variables_["property_storage_attribute"] = "strong";
311  if (IsRetainedName(variables_["name"])) {
312  variables_["storage_attribute"] = " NS_RETURNS_NOT_RETAINED";
313  }
314 }
315 
317 
319  io::Printer* printer) const {
320  printer->Print(variables_, "$storage_type$ *$name$;\n");
321 }
322 
324  io::Printer* printer) const {
325 
326  // Differs from SingleFieldGenerator::GeneratePropertyDeclaration() in that
327  // it uses pointers and deals with Objective C's rules around storage name
328  // conventions (init*, new*, etc.)
329 
330  printer->Print(variables_, "$comments$");
331  printer->Print(
332  variables_,
333  "@property(nonatomic, readwrite, $property_storage_attribute$, null_resettable) $property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n");
334  if (WantsHasProperty()) {
335  printer->Print(
336  variables_,
337  "/** Test to see if @c $name$ has been set. */\n"
338  "@property(nonatomic, readwrite) BOOL has$capitalized_name$$deprecated_attribute$;\n");
339  }
340  if (IsInitName(variables_.find("name")->second)) {
341  // If property name starts with init we need to annotate it to get past ARC.
342  // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
343  printer->Print(variables_,
344  "- ($property_type$ *)$name$ GPB_METHOD_FAMILY_NONE$deprecated_attribute$;\n");
345  }
346  printer->Print("\n");
347 }
348 
350  const FieldDescriptor* descriptor, const Options& options)
352  // Default to no comment and let the cases needing it fill it in.
353  variables_["array_comment"] = "";
354 }
355 
357 
360  if (variables_.find("array_property_type") == variables_.end()) {
361  variables_["array_property_type"] = variable("array_storage_type");
362  }
363 }
364 
366  io::Printer* printer) const {
367  printer->Print(variables_, "$array_storage_type$ *$name$;\n");
368 }
369 
371  io::Printer* printer) const {
372  printer->Print(variables_, "@dynamic $name$, $name$_Count;\n");
373 }
374 
376  io::Printer* printer) const {
377 
378  // Repeated fields don't need the has* properties, but they do expose a
379  // *Count (to check without autocreation). So for the field property we need
380  // the same logic as ObjCObjFieldGenerator::GeneratePropertyDeclaration() for
381  // dealing with needing Objective C's rules around storage name conventions
382  // (init*, new*, etc.)
383 
384  printer->Print(
385  variables_,
386  "$comments$"
387  "$array_comment$"
388  "@property(nonatomic, readwrite, strong, null_resettable) $array_property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n"
389  "/** The number of items in @c $name$ without causing the array to be created. */\n"
390  "@property(nonatomic, readonly) NSUInteger $name$_Count$deprecated_attribute$;\n");
391  if (IsInitName(variables_.find("name")->second)) {
392  // If property name starts with init we need to annotate it to get past ARC.
393  // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
394  printer->Print(variables_,
395  "- ($array_property_type$ *)$name$ GPB_METHOD_FAMILY_NONE$deprecated_attribute$;\n");
396  }
397  printer->Print("\n");
398 }
399 
401  // Consumer check the array size/existance rather than a has bit.
402  return false;
403 }
404 
406  return false; // The array having anything is what is used.
407 }
408 
410  const Options& options)
412  field_generators_(descriptor->field_count()),
413  extension_generators_(descriptor->extension_count()) {
414  // Construct all the FieldGenerators.
415  for (int i = 0; i < descriptor->field_count(); i++) {
416  field_generators_[i].reset(
418  }
419  for (int i = 0; i < descriptor->extension_count(); i++) {
420  extension_generators_[i].reset(
421  FieldGenerator::Make(descriptor->extension(i), options));
422  }
423 }
424 
426 
428  const FieldDescriptor* field) const {
429  GOOGLE_CHECK_EQ(field->containing_type(), descriptor_);
430  return *field_generators_[field->index()];
431 }
432 
434  return *extension_generators_[index];
435 }
436 
438  int total_bits = 0;
439  for (int i = 0; i < descriptor_->field_count(); i++) {
440  if (field_generators_[i]->RuntimeUsesHasBit()) {
441  field_generators_[i]->SetRuntimeHasBit(total_bits);
442  ++total_bits;
443  } else {
444  field_generators_[i]->SetNoHasBit();
445  }
446  int extra_bits = field_generators_[i]->ExtraRuntimeHasBitsNeeded();
447  if (extra_bits) {
448  field_generators_[i]->SetExtraRuntimeHasBitsBase(total_bits);
449  total_bits += extra_bits;
450  }
451  }
452  return total_bits;
453 }
454 
456  for (int i = 0; i < descriptor_->field_count(); i++) {
457  field_generators_[i]->SetOneofIndexBase(index_base);
458  }
459 }
460 
462  for (int i = 0; i < descriptor_->field_count(); i++) {
464  return true;
465  }
466  }
467 
468  return false;
469 }
470 
471 } // namespace objectivec
472 } // namespace compiler
473 } // namespace protobuf
474 } // namespace google
google::protobuf::compiler::objectivec::IsReferenceType
bool IsReferenceType(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:732
google::protobuf::compiler::objectivec::FieldGeneratorMap::DoesAnyFieldHaveNonZeroDefault
bool DoesAnyFieldHaveNonZeroDefault(void) const
Definition: objectivec_field.cc:461
google::protobuf::io::Printer::Print
void Print(const std::map< std::string, std::string > &variables, const char *text)
Definition: printer.cc:112
GOOGLE_CHECK_EQ
#define GOOGLE_CHECK_EQ(A, B)
Definition: logging.h:156
google::protobuf::compiler::objectivec::HasFieldPresence
bool HasFieldPresence(const FileDescriptor *file)
Definition: objectivec_helpers.h:121
google::protobuf::FieldDescriptor
Definition: src/google/protobuf/descriptor.h:515
google::protobuf::compiler::objectivec::FieldGenerator::ExtraRuntimeHasBitsNeeded
virtual int ExtraRuntimeHasBitsNeeded(void) const
Definition: objectivec_field.cc:223
google::protobuf::compiler::objectivec::FieldGeneratorMap::FieldGeneratorMap
FieldGeneratorMap(const Descriptor *descriptor, const Options &options)
Definition: objectivec_field.cc:409
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: strutil.cc:1480
google::protobuf::compiler::objectivec::SingleFieldGenerator::SingleFieldGenerator
SingleFieldGenerator(const SingleFieldGenerator &)=delete
google::protobuf::compiler::objectivec::FieldGenerator::SetExtraRuntimeHasBitsBase
virtual void SetExtraRuntimeHasBitsBase(int index_base)
Definition: objectivec_field.cc:227
options
Message * options
Definition: src/google/protobuf/descriptor.cc:3119
google::protobuf::compiler::objectivec::RepeatedMessageFieldGenerator
Definition: objectivec_message_field.h:61
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::objectivec::FieldGenerator::GenerateCFunctionDeclarations
virtual void GenerateCFunctionDeclarations(io::Printer *printer) const
Definition: objectivec_field.cc:169
google::protobuf::compiler::objectivec::FieldGeneratorMap::descriptor_
const Descriptor * descriptor_
Definition: objectivec_field.h:182
google::protobuf::compiler::objectivec::FieldGeneratorMap::extension_generators_
std::vector< std::unique_ptr< FieldGenerator > > extension_generators_
Definition: objectivec_field.h:184
google::protobuf::compiler::objectivec::SingleFieldGenerator::~SingleFieldGenerator
virtual ~SingleFieldGenerator()
Definition: objectivec_field.cc:257
google::protobuf::compiler::objectivec::UnCamelCaseFieldName
string UnCamelCaseFieldName(const string &name, const FieldDescriptor *field)
Definition: objectivec_helpers.cc:587
google::protobuf::compiler::objectivec::FieldGenerator
Definition: objectivec_field.h:45
google::protobuf::compiler::objectivec::FieldGeneratorMap::CalculateHasBits
int CalculateHasBits(void)
Definition: objectivec_field.cc:437
google::protobuf::compiler::objectivec::Options
Definition: objectivec_helpers.h:50
google::protobuf::compiler::objectivec::FieldGeneratorMap::field_generators_
std::vector< std::unique_ptr< FieldGenerator > > field_generators_
Definition: objectivec_field.h:183
objectivec_helpers.h
google::protobuf::compiler::objectivec::FieldGenerator::FieldGenerator
FieldGenerator(const FieldGenerator &)=delete
google::protobuf::compiler::objectivec::FieldGenerator::variable
string variable(const char *key) const
Definition: objectivec_field.h:83
google::protobuf::compiler::objectivec::BuildCommentsString
string BuildCommentsString(const SourceLocation &location, bool prefer_single_line)
Definition: objectivec_helpers.cc:928
google::protobuf::compiler::objectivec::RepeatedPrimitiveFieldGenerator
Definition: objectivec_primitive_field.h:75
descriptor
Descriptor * descriptor
Definition: php/ext/google/protobuf/protobuf.h:936
google::protobuf::compiler::objectivec::SingleFieldGenerator::GeneratePropertyDeclaration
virtual void GeneratePropertyDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:264
objectivec_field.h
google::protobuf::compiler::objectivec::FieldGenerator::GenerateFieldNumberConstant
void GenerateFieldNumberConstant(io::Printer *printer) const
Definition: objectivec_field.cc:163
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::FinishInitialization
virtual void FinishInitialization(void)
Definition: objectivec_field.cc:358
objectivec_enum_field.h
google::protobuf::compiler::objectivec::HasNonZeroDefaultValue
bool HasNonZeroDefaultValue(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:865
objectivec_message_field.h
FieldDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:129
google::protobuf::compiler::objectivec::DefaultValue
string DefaultValue(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:794
google::protobuf::Descriptor::field
const FieldDescriptor * field(int index) const
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::GeneratePropertyImplementation
virtual void GeneratePropertyImplementation(io::Printer *printer) const
Definition: objectivec_field.cc:370
google::protobuf::compiler::objectivec::RepeatedEnumFieldGenerator
Definition: objectivec_enum_field.h:60
google::protobuf::compiler::objectivec::ObjCObjFieldGenerator
Definition: objectivec_field.h:125
strutil.h
google::protobuf::FieldDescriptor::file
const FileDescriptor * file() const
google::protobuf::compiler::objectivec::IsInitName
bool IsInitName(const string &name)
Definition: objectivec_helpers.cc:386
google::protobuf::compiler::objectivec::GetOptionalDeprecatedAttribute
string GetOptionalDeprecatedAttribute(const TDescriptor *descriptor, const FileDescriptor *file=NULL, bool preSpace=true, bool postNewline=false)
Definition: objectivec_helpers.h:158
google::protobuf::compiler::objectivec::PrimitiveFieldGenerator
Definition: objectivec_primitive_field.h:43
google::protobuf::compiler::objectivec::BuildFlagsString
string BuildFlagsString(const FlagType flag_type, const std::vector< string > &strings)
Definition: objectivec_helpers.cc:910
google::protobuf::compiler::objectivec::ClassName
string ClassName(const Descriptor *descriptor)
Definition: objectivec_helpers.cc:460
google::protobuf::compiler::objectivec::MessageFieldGenerator
Definition: objectivec_message_field.h:43
printer.h
google::protobuf::compiler::objectivec::FieldGeneratorMap::get_extension
const FieldGenerator & get_extension(int index) const
Definition: objectivec_field.cc:433
google::protobuf::compiler::objectivec::GPBGenericValueFieldName
string GPBGenericValueFieldName(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:754
google::protobuf::compiler::objectivec::FieldGenerator::Make
static FieldGenerator * Make(const FieldDescriptor *field, const Options &options)
Definition: objectivec_field.cc:113
google::protobuf::compiler::objectivec::GetCapitalizedType
string GetCapitalizedType(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:619
google::protobuf::compiler::objectivec::FieldGeneratorMap::SetOneofIndexBase
void SetOneofIndexBase(int index_base)
Definition: objectivec_field.cc:455
google::protobuf::compiler::objectivec::OBJECTIVECTYPE_ENUM
@ OBJECTIVECTYPE_ENUM
Definition: objectivec_helpers.h:147
google::protobuf::compiler::objectivec::FieldName
string FieldName(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:538
google::protobuf::Descriptor::field_count
int field_count() const
google::protobuf::compiler::objectivec::FieldGenerator::SetOneofIndexBase
void SetOneofIndexBase(int index_base)
Definition: objectivec_field.cc:235
google::protobuf::compiler::objectivec::PrimitiveObjFieldGenerator
Definition: objectivec_primitive_field.h:61
google::protobuf::compiler::objectivec::SingleFieldGenerator::GenerateFieldStorageDeclaration
virtual void GenerateFieldStorageDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:259
google::protobuf::compiler::objectivec::FieldNameCapitalized
string FieldNameCapitalized(const FieldDescriptor *field)
Definition: objectivec_helpers.cc:553
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::GeneratePropertyDeclaration
virtual void GeneratePropertyDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:375
location
GLint location
Definition: glcorearb.h:3074
google::protobuf::io::Printer
Definition: printer.h:181
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::RepeatedFieldGenerator
RepeatedFieldGenerator(const RepeatedFieldGenerator &)=delete
i
int i
Definition: gmock-matchers_test.cc:764
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::~RepeatedFieldGenerator
virtual ~RepeatedFieldGenerator()
Definition: objectivec_field.cc:356
google::protobuf::compiler::objectivec::SingleFieldGenerator::WantsHasProperty
virtual bool WantsHasProperty(void) const
Definition: objectivec_field.cc:287
google::protobuf::compiler::objectivec::FieldGenerator::SetNoHasBit
void SetNoHasBit(void)
Definition: objectivec_field.cc:219
google::protobuf::compiler::objectivec::EnumFieldGenerator
Definition: objectivec_enum_field.h:43
google::protobuf::compiler::objectivec::MapFieldGenerator
Definition: objectivec_map_field.h:43
google::protobuf::compiler::objectivec::ObjCObjFieldGenerator::GeneratePropertyDeclaration
virtual void GeneratePropertyDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:323
google::protobuf::compiler::objectivec::SingleFieldGenerator::RuntimeUsesHasBit
virtual bool RuntimeUsesHasBit(void) const
Definition: objectivec_field.cc:299
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::RuntimeUsesHasBit
virtual bool RuntimeUsesHasBit(void) const
Definition: objectivec_field.cc:405
objectivec_map_field.h
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::GenerateFieldStorageDeclaration
virtual void GenerateFieldStorageDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:365
google::protobuf::compiler::objectivec::FLAGTYPE_FIELD
@ FLAGTYPE_FIELD
Definition: objectivec_helpers.h:154
google::protobuf::compiler::objectivec::OBJECTIVECTYPE_MESSAGE
@ OBJECTIVECTYPE_MESSAGE
Definition: objectivec_helpers.h:148
google::protobuf::compiler::objectivec::FieldGenerator::GenerateFieldDescription
void GenerateFieldDescription(io::Printer *printer, bool include_default) const
Definition: objectivec_field.cc:184
google::protobuf::compiler::objectivec::FieldGeneratorMap::get
const FieldGenerator & get(const FieldDescriptor *field) const
Definition: objectivec_field.cc:427
google::protobuf::compiler::objectivec::FieldGenerator::GenerateCFunctionImplementations
virtual void GenerateCFunctionImplementations(io::Printer *printer) const
Definition: objectivec_field.cc:174
google::protobuf::OneofDescriptor::index
int index() const
Definition: src/google/protobuf/descriptor.h:2103
google::protobuf::compiler::objectivec::FieldGenerator::DetermineForwardDeclarations
virtual void DetermineForwardDeclarations(std::set< string > *fwd_decls) const
Definition: objectivec_field.cc:179
wire_format.h
google::protobuf::Descriptor
Definition: src/google/protobuf/descriptor.h:231
google::protobuf::FieldDescriptor::TYPE_GROUP
@ TYPE_GROUP
Definition: src/google/protobuf/descriptor.h:535
google::protobuf::compiler::objectivec::IsRetainedName
bool IsRetainedName(const string &name)
Definition: objectivec_helpers.cc:377
google::protobuf::compiler::objectivec::FieldGenerator::variables_
std::map< string, string > variables_
Definition: objectivec_field.h:101
google::protobuf::compiler::objectivec::ObjCObjFieldGenerator::ObjCObjFieldGenerator
ObjCObjFieldGenerator(const ObjCObjFieldGenerator &)=delete
google::protobuf::FieldDescriptor::containing_oneof
const OneofDescriptor * containing_oneof() const
google::protobuf::compiler::objectivec::FieldGenerator::descriptor_
const FieldDescriptor * descriptor_
Definition: objectivec_field.h:100
google::protobuf::compiler::objectivec::ObjCObjFieldGenerator::GenerateFieldStorageDeclaration
virtual void GenerateFieldStorageDeclaration(io::Printer *printer) const
Definition: objectivec_field.cc:318
google::protobuf::compiler::objectivec::FieldGenerator::~FieldGenerator
virtual ~FieldGenerator()
Definition: objectivec_field.cc:161
objectivec_primitive_field.h
google::protobuf::compiler::objectivec::FieldGeneratorMap::~FieldGeneratorMap
~FieldGeneratorMap()
Definition: objectivec_field.cc:425
descriptor_
const Descriptor * descriptor_
Definition: field_comparator_test.cc:56
google::protobuf::compiler::objectivec::SingleFieldGenerator
Definition: objectivec_field.h:104
google::protobuf::FieldDescriptor::TYPE_ENUM
@ TYPE_ENUM
Definition: src/google/protobuf/descriptor.h:540
google::protobuf::compiler::objectivec::ObjCObjFieldGenerator::~ObjCObjFieldGenerator
virtual ~ObjCObjFieldGenerator()
Definition: objectivec_field.cc:316
google::protobuf::compiler::objectivec::GetObjectiveCType
ObjectiveCType GetObjectiveCType(FieldDescriptor::Type field_type)
Definition: objectivec_helpers.cc:665
index
GLuint index
Definition: glcorearb.h:3055
google::protobuf::compiler::objectivec::FieldGenerator::SetRuntimeHasBit
void SetRuntimeHasBit(int has_index)
Definition: objectivec_field.cc:215
compiler
Definition: plugin.pb.cc:22
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf::compiler::objectivec::FieldGenerator::FinishInitialization
virtual void FinishInitialization(void)
Definition: objectivec_field.cc:243
google::protobuf::compiler::objectivec::RepeatedFieldGenerator::WantsHasProperty
virtual bool WantsHasProperty(void) const
Definition: objectivec_field.cc:400
google::protobuf::compiler::objectivec::SingleFieldGenerator::GeneratePropertyImplementation
virtual void GeneratePropertyImplementation(io::Printer *printer) const
Definition: objectivec_field.cc:278


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