Issue 6413: Concrete ValueType _init class problem (cxx_revision) Source: AT&T (Dr. Duncan Grisby, ) Nature: Revision Severity: Significant Summary: The second-to-last paragraph of section 1.17.10.3 says "For valuetypes that have no operations or initializers, a concrete type-specific factory class is generated whose implementation of the create_for_unmarshal function simply constructs an instance of the OBV_ class for the valuetype using new and the default constructor." As specified, that requires the generation of invalid C++. The OBV_ class is abstract since it does not have implementations of the ValueBase reference counting functions. Perhaps the intention is that the OBV_ classes in such cases should derive from DefaultValueRefCountBase. However, the wording and explanation in section 1.17.6 explicitly forbids this: "Note that it is the application-supplied concrete valuetype classes that must derive from these mix-in classes, not the valuetype classes generated by the IDL compiler." One solution that avoids the problem, and avoids restricting the application's use of the OBV_ classes is to generate yet another class that derives from both the OBV_ class and DefaultValueRefCountBase, for instantiation by the _init class's create_for_unmarshal function. Resolution: Revised Text: Actions taken: November 3, 2003: received issue Discussion: deferred in June 2011 to the next RTF End of Annotations:===== m: webmaster@omg.org Date: 03 Nov 2003 17:24:07 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Duncan Grisby Company: Apasphere Ltd mailFrom: dgrisby@apasphere.com Notification: Yes Specification: C++ Language Mapping Section: 1.17.10.3 FormalNumber: formal/03-06-03 Version: 1.1 RevisionDate: 06/2003 Page: 1-90 Nature: Revision Severity: Significant HTTP User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Description Issue: Concrete ValueType _init class problem The second-to-last paragraph of section 1.17.10.3 says "For valuetypes that have no operations or initializers, a concrete type-specific factory class is generated whose implementation of the create_for_unmarshal function simply constructs an instance of the OBV_ class for the valuetype using new and the default constructor." As specified, that requires the generation of invalid C++. The OBV_ class is abstract since it does not have implementations of the ValueBase reference counting functions. Perhaps the intention is that the OBV_ classes in such cases should derive from DefaultValueRefCountBase. However, the wording and explanation in section 1.17.6 explicitly forbids this: "Note that it is the application-supplied concrete valuetype classes that must derive from these mix-in classes, not the valuetype classes generated by the IDL compiler." One solution that avoids the problem, and avoids restricting the application's use of the OBV_ classes is to generate yet another class that derives from both the OBV_ class and DefaultValueRefCountBase, for instantiation by the _init class's create_for_unmarshal function. Date: Tue, 04 Nov 2003 12:38:35 -0800 From: Jonathan Biggar Organization: LinuxCare User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en-us, en To: cxx_revision@omg.org Subject: Re: Issue/Bug Report Issue: Concrete ValueType _init class problem The second-to-last paragraph of section 1.17.10.3 says "For valuetypes that have no operations or initializers, a concrete type-specific factory class is generated whose implementation of the create_for_unmarshal function simply constructs an instance of the OBV_ class for the valuetype using new and the default constructor." As specified, that requires the generation of invalid C++. The OBV_ class is abstract since it does not have implementations of the ValueBase reference counting functions. Perhaps the intention is that the OBV_ classes in such cases should derive from DefaultValueRefCountBase. However, the wording and explanation in section 1.17.6 explicitly forbids this: "Note that it is the application-supplied concrete valuetype classes that must derive from these mix-in classes, not the valuetype classes generated by the IDL compiler." One solution that avoids the problem, and avoids restricting the application's use of the OBV_ classes is to generate yet another class that derives from both the OBV_ class and DefaultValueRefCountBase, for instantiation by the _init class's create_for_unmarshal function. I think a better solution is to change the above paragraph to state that concrete OBV_ classes (ones without operations & initializers) will be generated by the IDL compiler inheriting from DefaultValueRefCountBase. The purpose of the issue resolution that made these classes concrete is to avoid requiring the programmer to derive a new class that adds no behavior just to use the valuetype. Having them inherit from DefaultValueRefCountBase should have been part of that fix. -- Jon Biggar Floorboard Software jon@floorboard.com