Issue 89: Correct IIOP marshalling of union TypeCodes (interop) Source: (, ) Nature: Uncategorized Severity: Summary: Summary: There is a problem with marshalling of union TypeCodes where multiple discriminant values select the same arm of the union. Resolution: closed with revised text Revised Text: Actions taken: August 22, 1996: received issue March 26, 1998: closed issue Discussion: End of Annotations:===== From geoff Thu Aug 22 16:29:30 1996 Received: by amethyst.omg.org.omg.org (5.4R2.01/1.34) id AA14934; Thu, 22 Aug 1996 16:29:30 -0400 Date: Thu, 22 Aug 1996 16:29:30 -0400 From: geoff (Geoffrey Speare) Message-Id: <9608222029.AA14934@amethyst.omg.org.omg.org> To: issue-logger@omg.org Subject: Correct IIOP marshalling of union TypeCodes where multiple discriminant values select the same arm X-Omg-Issue: 89 Sender: Bill Janssen From: Bill Janssen To: interop@omg.org, issues@omg.org, orbos@omg.org Subject: Correct IIOP marshalling of union TypeCodes where multiple discriminant values select the same arm Cc: ilu-core.PARC@xerox.com Date: Mon, 19 Aug 1996 22:47:02 PDT Leaving aside the general insanity of the rules for IIOP marshalling of TypeCodes, there seems to be a problem with marshalling of union typecodes, as follows: OMG IDL allows multiple discriminant values to select the same arm of a union, as in union u switch (long) { case 1: case 2: float a; case 3: long b; default: short c; }; However, the IIOP marshalling for union typecodes only allows for one discriminant value per arm. My suggested fix would be to remove the OMG IDL provision for unions to have multiple discriminant values on any single arm. Additionally, marshalling of unions and typecodes could be made considerably more efficient if only one discriminant type, long, was allowed. Bill From geoff Thu Aug 22 16:29:54 1996 Received: by amethyst.omg.org.omg.org (5.4R2.01/1.34) id AA14945; Thu, 22 Aug 1996 16:29:54 -0400 Date: Thu, 22 Aug 1996 16:29:54 -0400 From: geoff (Geoffrey Speare) Message-Id: <9608222029.AA14945@amethyst.omg.org.omg.org> To: issue-logger@omg.org Subject: Re: Correct IIOP marshalling of union TypeCodes where multiple discriminant values select the same arm X-Omg-Issue: 89 Sender: jon@sems.com Date: Tue, 20 Aug 1996 14:30:47 -0700 From: Jonathan Biggar Organization: Seagate Enterprise Management Software Mime-Version: 1.0 To: Bill Janssen Cc: interop@omg.org, issues@omg.org, orbos@omg.org, ilu-core.PARC@xerox.com Subject: Re: Correct IIOP marshalling of union TypeCodes where multiple discriminant values select the same arm Content-Transfer-Encoding: 7bit Bill Janssen wrote: > union u switch (long) { > case 1: > case 2: > float a; > case 3: > long b; > default: > short c; > }; > > However, the IIOP marshalling for union typecodes only allows for one > discriminant value per arm. I asked this question a while back, and was told the correct answer: The typecode (and equivalent Interface Repository UnionDef) split your case 1 & 2 above into separate cases, which the same name 'a'. So, TypeCode::member_count() would return 4, default_index would return 3, member_name(0) and member_name(1) would return 'a', etc. There is no problem here. Jon Biggar jon@sems.com From geoff Thu Aug 22 16:30:02 1996 Received: by amethyst.omg.org.omg.org (5.4R2.01/1.34) id AA14950; Thu, 22 Aug 1996 16:30:02 -0400 Date: Thu, 22 Aug 1996 16:30:02 -0400 From: geoff (Geoffrey Speare) Message-Id: <9608222030.AA14950@amethyst.omg.org.omg.org> To: issue-logger@omg.org Subject: IIOP marshalling of union TypeCode `null' arms X-Omg-Issue: 89 Date: Tue, 20 Aug 1996 15:16:42 PDT Sender: Bill Janssen From: Bill Janssen To: interop@omg.org, issues@omg.org, orbos@omg.org Subject: IIOP marshalling of union TypeCode `null' arms In-Reply-To: <9608201943.AA25290@arch4.ho.att.com> When I asked about multiple selector values for a TypeCode arm, one person sent me the following: > There can also be null type arms for a union. This comes from having > a discrimnator value which is defined in the discriminator type (usually > enum) but which is not listed in the union spec as a case. This would > require sending a null typecode when marshalled. He was mistaken, right? This would seem complete nonsense. Consider a union type with a `long' discriminant. Would one have to marshal all into the typecode representation each integer value not explicitly called out in the OMG IDL description of the union? Surely null arms are marshalled `implicitly'; that is, they are just understood to be there. By the way, why are null arms allowed in union types anyway? Shouldn't this just be an error? Wouldn't the world be better off if it was defined that way in the IDL spec? Bill From geoff Thu Aug 22 16:40:18 1996 Received: by amethyst.omg.org.omg.org (5.4R2.01/1.34) id AA15053; Thu, 22 Aug 1996 16:40:18 -0400 Date: Thu, 22 Aug 1996 16:40:18 -0400 From: geoff (Geoffrey Speare) Message-Id: <9608222040.AA15053@amethyst.omg.org.omg.org> To: issue-logger@omg.org Subject: unions with null arms X-Omg-Issue: 89 Date: Thu, 22 Aug 96 16:21:36 EDT From: ter@arch4.ho.att.com (T E Rutt) To: interop@omg.org, issues@omg.org, orbos@omg.org Subject: unions with null arms >From: Bill Janssen >To: interop@omg.org, issues@omg.org, orbos@omg.org >Subject: IIOP marshalling of union TypeCode `null' arms >References: <9608201943.AA25290@arch4.ho.att.com> >Content-Type: text > >When I asked about multiple selector values for a TypeCode arm, one >person sent me the following: > >> There can also be null type arms for a union. This comes from having >> a discrimnator value which is defined in the discriminator type (usually >> enum) but which is not listed in the union spec as a case. This would >> require sending a null typecode when marshalled. > >He was mistaken, right? This would seem complete nonsense. Consider a >union type with a `long' discriminant. Would one have to marshal all >into the typecode representation each integer value not explicitly >called out in the OMG IDL description of the union? Surely null arms >are marshalled `implicitly'; that is, they are just understood to be >there. > >By the way, why are null arms allowed in union types anyway? Shouldn't >this just be an error? Wouldn't the world be better off if it was >defined that way in the IDL spec? > >Bill > The corba spec v2.0 on page 3-24 states: It is not required that all posssible values of the union discriminator be listed in the . The value of a union is the value of the discriminaotr together with one of the following: . if the discriminaotr value was explicilty listed in the case ... . if a default case label was specified ... . No additional value This last use is what I was talking about. Tom Rutt >From mail Mon Oct 28 18:07 EST 1996 Date: Tue, 29 Oct 1996 00:03:06 +0100 From: sergior@tid.es (RODRIGUEZ LOMBARDERO) To: interop@omg.org Subject: Marshalling indirection and message fragmentation Content-Length: 494 Hello ! I am reading the IIOP 1.1 specifications and there is one point I am not being able to understand. This is about how message fragmentation affects the use of indirections in the marshalling of complex TypeCodes. I don't understand how it is posible to calculate and interpret offsets related to TypeCodes marshalled in previous messages and, consequently, in different CDR buffers. It would be great if someone could explain me how to manage this scenario. Thanks in advance. Issue 89: Correct IIOP marshalling of union TypeCodes (interop) Click here for this issue's archive. Source: Xerox (Mr. William C. Janssen, Jr., janssen@parc.xerox.com) Nature: Uncategorized Severity: Summary: There is a problem with marshalling of union TypeCodes where multiple discriminant values select the same arm of the union. Resolution: Do not understand problem. It seems that any one of the discriminant values could be used to signal the type of the arm. Revised Text: Actions taken: Proposed no revision. August 22, 1996: Received issue