Lines Matching refs:descriptor

104 static bool generateIncidentSectionsCpp(Descriptor const* descriptor)
110 N = descriptor->field_count();
112 const FieldDescriptor* field = descriptor->field(i);
189 static inline PrivacyFlags getPrivacyFlags(const Descriptor* descriptor) {
190 return descriptor->options().GetExtension(msg_privacy);
194 static inline Destination getMessageDest(const Descriptor* descriptor, const Destination overridden) {
195 return overridden != DEST_UNSET ? overridden : getPrivacyFlags(descriptor).dest();
224 static inline string getMessageName(const Descriptor* descriptor, const Destination overridden) {
226 return replaceAll(descriptor->full_name(), '.', "_") + "__MSG__" +
227 to_string(getMessageDest(descriptor, overridden));
244 static bool isDefaultMessageImpl(const Descriptor* descriptor, const Destination dest, set<string>* parents) {
245 const int N = descriptor->field_count();
246 const Destination messageDest = getMessageDest(descriptor, dest);
247 parents->insert(descriptor->full_name());
249 const FieldDescriptor* field = descriptor->field(i);
267 parents->erase(descriptor->full_name());
273 static bool isDefaultMessage(const Descriptor* descriptor, const Destination dest) {
275 return isDefaultMessageImpl(descriptor, dest, &parents);
284 static vector<const FieldDescriptor*> sortFields(const Descriptor* descriptor) {
286 fields.reserve(descriptor->field_count());
287 for (int i=0; i<descriptor->field_count(); i++) {
288 fields.push_back(descriptor->field(i));
297 // Returns false if the descriptor doesn't have any non default privacy flags set, including its submessages
298 static bool generatePrivacyFlags(const Descriptor* descriptor, const Destination overridden,
300 const string messageName = getMessageName(descriptor, overridden);
301 const Destination messageDest = getMessageDest(descriptor, overridden);
311 vector<const FieldDescriptor*> fieldsInOrder = sortFields(descriptor);
392 static bool generateSectionListCpp(Descriptor const* descriptor) {
404 for (int i=0; i<descriptor->field_count(); i++) {
405 const FieldDescriptor* field = descriptor->field(i);
452 vector<const FieldDescriptor*> fieldsInOrder = sortFields(descriptor);
454 const Destination incidentDest = getPrivacyFlags(descriptor).dest();
531 static void generateCsv(Descriptor const* descriptor, const string& indent, set<string>* parents, const Destination containerDest = DEST_UNSET) {
534 for (int i=0; i<descriptor->field_count(); i++) {
535 const FieldDescriptor* field = descriptor->field(i);
567 Descriptor const* descriptor = IncidentProto::descriptor();
570 return !generateIncidentSectionsCpp(descriptor);
573 return !generateSectionListCpp(descriptor);
578 for (int i=0; i<descriptor->field_count(); i++) {
579 const FieldDescriptor* field = descriptor->field(i);