diff options
author | Chris Fallin <cfallin@c1f.net> | 2015-01-14 11:18:20 -0800 |
---|---|---|
committer | Chris Fallin <cfallin@c1f.net> | 2015-01-14 11:18:20 -0800 |
commit | 87a18f37743efde6f66f77209c98400cdec67cbe (patch) | |
tree | fcbab052ead901543a135a15e25fee36189b15bd /upb/bindings/googlepb/bridge.cc | |
parent | bebdc009b484295f06185b5bab884a3754bbbacd (diff) |
Support oneof defs in upb.
This change adds support for a OneofDef (upb_oneofdef), which represents
a 'oneof' as introduced by Protocol Buffers. This is semantically a
union type that contains fields and in turn may be added to a
MessageDef. This change does not alter parsing or the handler
abstraction in any way, because a oneof has impact only at a higher
semantic level (i.e., any sort of storage of the fields in a message
object), which is user-specific with respect to upb.
Diffstat (limited to 'upb/bindings/googlepb/bridge.cc')
-rw-r--r-- | upb/bindings/googlepb/bridge.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/upb/bindings/googlepb/bridge.cc b/upb/bindings/googlepb/bridge.cc index 6ae8868..2a2bbbf 100644 --- a/upb/bindings/googlepb/bridge.cc +++ b/upb/bindings/googlepb/bridge.cc @@ -246,7 +246,8 @@ const Handlers* CodeCache::GetMaybeUnfrozenWriteHandlers( to_freeze_.push_back(h); const goog::Descriptor* d = m.GetDescriptor(); - for (upb::MessageDef::const_iterator i = md->begin(); i != md->end(); ++i) { + for (upb::MessageDef::const_field_iterator i = md->field_begin(); + i != md->field_end(); ++i) { const FieldDef* upb_f = *i; const goog::FieldDescriptor* proto2_f = |