Home
last modified time | relevance | path

Searched refs:oneofs (Results 1 – 25 of 43) sorted by relevance

12

/third_party/protobuf/docs/
Dimplementing_proto3_presence.md60 proto3 presence. This is the major benefit of synthetic oneofs.
62 This design does leave some cruft in descriptors. Synthetic oneofs are a
65 APIs. It is never safe to drop synthetic oneofs from a proto schema. Code
66 generators can (and should) skip synthetic oneofs when generating a user-facing
68 consumed programmatically, it is important to keep the synthetic oneofs around.
71 oneofs (see [API Changes](#api-changes) below). This is a convenient way to omit
72 synthetic oneofs in code generators.
211 synthetic oneofs.
273 // real_containing_oneof() returns nullptr for synthetic oneofs.
278 #### To iterate over all oneofs
[all …]
/third_party/protobuf/python/google/protobuf/internal/
Dgenerator_test.py293 self.assertEqual(1, len(desc.oneofs))
294 self.assertEqual('oneof_field', desc.oneofs[0].name)
295 self.assertEqual(0, desc.oneofs[0].index)
296 self.assertIs(desc, desc.oneofs[0].containing_type)
297 self.assertIs(desc.oneofs[0], desc.oneofs_by_name['oneof_field'])
302 set([field.name for field in desc.oneofs[0].fields]))
305 self.assertIs(desc.oneofs[0], field_desc.containing_oneof)
Ddescriptor_pool_test.py239 self.assertEqual(1, len(msg2.oneofs))
241 self.assertEqual(2, len(msg2.oneofs[0].fields))
243 self.assertEqual(msg2.oneofs[0],
245 self.assertIn(msg2.fields_by_name[name], msg2.oneofs[0].fields)
/third_party/protobuf/php/src/Google/Protobuf/
DType.php35 private $oneofs; variable in Google\\Protobuf\\Type
140 return $this->oneofs;
153 $this->oneofs = $arr;
/third_party/protobuf/src/google/protobuf/compiler/csharp/
Dcsharp_reflection_class.cc276 std::vector<std::string> oneofs; in WriteGeneratedCodeInfo() local
277 oneofs.reserve(descriptor->oneof_decl_count()); in WriteGeneratedCodeInfo()
279 oneofs.push_back(UnderscoresToCamelCase(descriptor->oneof_decl(i)->name(), true)); in WriteGeneratedCodeInfo()
281 printer->Print("new[]{ \"$oneofs$\" }, ", "oneofs", Join(oneofs, "\", \"")); in WriteGeneratedCodeInfo()
/third_party/protobuf/python/google/protobuf/
Ddescriptor.py292 is_extendable=True, extension_ranges=None, oneofs=None, argument
304 is_extendable=True, extension_ranges=None, oneofs=None, argument
351 self.oneofs = oneofs if oneofs is not None else []
352 self.oneofs_by_name = dict((o.name, o) for o in self.oneofs)
353 for oneof in self.oneofs:
Ddescriptor_pool.py866 oneofs = [
884 oneofs=oneofs,
904 oneofs[oneof_index].fields.append(fields[field_index])
905 fields[field_index].containing_oneof = oneofs[oneof_index]
/third_party/protobuf/objectivec/
DGPBStruct.pbobjc.m230 static const char *oneofs[] = {
233 [localDescriptor setupOneofs:oneofs
234 count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
260 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
DGPBDescriptor.h72 @property(nonatomic, readonly, strong, nullable) NSArray<GPBOneofDescriptor*> *oneofs;
DGPBDescriptor.m108 @synthesize oneofs = oneofs_;
192 NSMutableArray *oneofs = [[NSMutableArray alloc] initWithCapacity:count];
200 [oneofs addObject:oneofDescriptor];
204 oneofs_ = oneofs;
/third_party/protobuf/java/core/src/main/java/com/google/protobuf/
DDescriptors.java702 return Collections.unmodifiableList(Arrays.asList(oneofs)); in getOneofs()
707 return Collections.unmodifiableList(Arrays.asList(oneofs).subList(0, realOneofCount)); in getRealOneofs()
828 private final OneofDescriptor[] oneofs; field in Descriptors.Descriptor
854 this.oneofs = new OneofDescriptor[0]; in Descriptor()
873 oneofs = new OneofDescriptor[proto.getOneofDeclCount()]; in Descriptor()
875 oneofs[i] = new OneofDescriptor(proto.getOneofDecl(i), file, this, i); in Descriptor()
899 oneofs[i].fields = new FieldDescriptor[oneofs[i].getFieldCount()]; in Descriptor()
900 oneofs[i].fieldCount = 0; in Descriptor()
910 for (OneofDescriptor oneof : this.oneofs) { in Descriptor()
919 this.realOneofCount = this.oneofs.length - syntheticOneofCount; in Descriptor()
[all …]
DDescriptorMessageInfoFactory.java665 private OneofInfo[] oneofs = new OneofInfo[2]; field in DescriptorMessageInfoFactory.OneofState
669 if (index >= oneofs.length) { in getOneof()
671 oneofs = Arrays.copyOf(oneofs, index * 2); in getOneof()
673 OneofInfo info = oneofs[index]; in getOneof()
676 oneofs[index] = info; in getOneof()
DGeneratedMessage.java2054 oneofs = new OneofAccessor[descriptor.getOneofs().size()];
2121 int oneofsSize = oneofs.length;
2123 oneofs[i] = new OneofAccessor(
2136 private final OneofAccessor[] oneofs;
2159 return oneofs[oneof.getIndex()];
DGeneratedMessageV3.java1926 oneofs = new OneofAccessor[descriptor.getOneofs().size()];
1988 int oneofsSize = oneofs.length;
1990 oneofs[i] =
2003 private final OneofAccessor[] oneofs;
2026 return oneofs[oneof.getIndex()];
/third_party/protobuf/ruby/ext/google/protobuf_c/
Dstorage.c513 layout->oneofs = NULL; in create_layout()
516 layout->oneofs = ALLOC_N(MessageOneof, noneofs); in create_layout()
525 layout->oneofs[i].offset = -1; in create_layout()
653 layout->oneofs[upb_oneofdef_index(oneof)].offset = off; in create_layout()
668 layout->oneofs[upb_oneofdef_index(oneof)].case_offset = off; in create_layout()
681 assert(layout->oneofs[i].offset != -1); in create_layout()
699 xfree(layout->oneofs); in free_layout()
728 layout->oneofs[upb_oneofdef_index(oneof)].case_offset); in slot_oneof_case()
1025 MessageOneof* oneof = &layout->oneofs[i]; in layout_mark()
/third_party/protobuf/src/google/protobuf/util/internal/testdata/
Doneofs.proto31 // Proto to test proto3 oneofs.
34 package proto_util_converter.testing.oneofs;
/third_party/protobuf/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/
Dunittest_issues.proto99 // but doesn't include oneofs.
100 // TODO: Consider adding oneofs to TestFieldOrderings, although
/third_party/protobuf/csharp/protos/
Dunittest_issues.proto100 // but doesn't include oneofs.
101 // TODO: Consider adding oneofs to TestFieldOrderings, although
/third_party/protobuf/objectivec/Tests/
DGPBDescriptorTests.m310 // There are two oneofs in there.
311 XCTAssertEqual(descriptor.oneofs.count, 2U);
320 // Check the oneofs to have what is expected.
357 // Check pointers back to the enclosing oneofs.
/third_party/protobuf/src/google/protobuf/
Dtype.proto53 repeated string oneofs = 3; field
129 // The index of the field type in `Type.oneofs`, for message or enumeration
Dtype.pb.h326 const std::string& oneofs(int index) const;
337 const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& oneofs() const;
1475 inline const std::string& Type::oneofs(int index) const { in oneofs() function
1522 Type::oneofs() const { in oneofs() function
/third_party/protobuf/ruby/tests/
Dbasic_test_proto2.proto151 // Wrappers in oneofs don't make sense, but we still need to make sure they
Dbasic_test.proto170 // Wrappers in oneofs don't make sense, but we still need to make sure they
/third_party/protobuf/python/google/protobuf/pyext/
Ddescriptor_containers.cc1262 namespace oneofs { namespace
1307 return descriptor::NewMappingByName(&oneofs::ContainerDef, descriptor); in NewMessageOneofsByName()
1311 return descriptor::NewSequence(&oneofs::ContainerDef, descriptor); in NewMessageOneofsSeq()
/third_party/protobuf/src/google/protobuf/util/
Dtype_resolver_util_test.cc107 return type.oneofs(field->oneof_index() - 1) == oneof_name; in FieldInOneof()

12