On Mon, Oct 03, 2011 at 10:44:45AM -0500, Anthony Liguori wrote: > >>>Specifically > >>>the case where first field in a sequence tells > >>>you the meaning of the following ones? > >> > >>Can you give me the example in ASN.1? > >> > >>Regards, > >> > >>Anthony Liguori > > > >That would be a selection from CHOICE. > >Note that CHOICE doesn't affect encoding on the wire: > >BER just uses the underlying type. > > Ah, so that's a union value. I think we would have to decide how we > wanted to model unions.
IMHO it's easier to use if a visitor for the right type is called, not a top level one for the union. > Presumably, the selected CHOICE is > indicated by some other field? Exactly. Some function of some other field :) > I would think it's a good idea to > use the type information to identify which selection of a CHOICE was > chosen. Not sure what this means. We really need to look at the serialized field to know which selection was chose. In theory the field that dictates the meaning might come after the choice, but I think we don't limit outselves too much if we require it to come before in a sequence. > I had implemented a union type in the old glib branch but that was > based on a struct with an enum element and then the appropriate > value element. > > Regards, > > Anthony Liguori Yes, this seems limiting. -- MST