[omniORB] omniidl generated headers

Kevin Wooten kwooten@itracs.com
Fri Oct 4 00:04:00 2002


This is a multi-part message in MIME format.

------_=_NextPart_001_01C26B31.07A32E65
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

It seems to me that a lot of the code in the idl generated header files
can be implemented purely in templates, yet it is still generating a
class for it.
To use an example:
=20
            //IDL
            union Variant {
                        ...
            };
            typedef sequence<Variant> VariantSeq;
=20
            //produces the following c++
=20
class VariantSeq : public _CORBA_Unbounded_Sequence< Variant >  {
public:
typedef VariantSeq_var _var_type;
inline VariantSeq() {}
inline VariantSeq(const VariantSeq& _s)
: _CORBA_Unbounded_Sequence< Variant > (_s) {}
=20
inline VariantSeq(_CORBA_ULong _max)
: _CORBA_Unbounded_Sequence< Variant > (_max) {}
inline VariantSeq(_CORBA_ULong _max, _CORBA_ULong _len, Variant* _val,
_CORBA_Boolean _rel=3D0)
: _CORBA_Unbounded_Sequence< Variant > (_max, _len, _val, _rel) {}
=20
 =20
inline VariantSeq& operator =3D (const VariantSeq& _s) {
_CORBA_Unbounded_Sequence< Variant > ::operator=3D(_s);
return *this;
}
};
=20
This produces a type that is functionally the same as:
=20
                     typedef _CORBA_Unbounded_Sequence< Variant >
VariantSeq;
=20
although the VariantSeq produced by IDL is a distinct type in c++.
=20
The only difference this creates is that two IDL typedefs to the same
type are distinctly different in the typing system of c++.
Example IDL:
                     typedef sequence<Variant> VariantSeq;
                     typedef sequence<Variant> AnotherSeq;
=20
This IDL produces two distinctly different, yet functionally the same,
c++ types.
=20
Is this a requirement of the CORBA mapping, or some other requirement?
If it is, does anyone know the reason for it?

------_=_NextPart_001_01C26B31.07A32E65
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C26AF6.5AF28EE0">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:windowtext;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>It seems to me that a lot of the code in the <span
class=3DSpellE>idl</span> generated header files can be implemented =
purely in
templates, yet it is still generating a class for =
it.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>To use an example:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>//IDL<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><span
class=3DGramE>union</span> Variant {<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; </span>&#8230;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>};<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><span
class=3DSpellE><span class=3DGramE>typedef</span></span> =
sequence&lt;Variant&gt; <span
class=3DSpellE>VariantSeq</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>//produces
the following c++<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-indent:.5in'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>class</span></font></span><f=
ont
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span> : public _<span =
class=3DSpellE>CORBA_Unbounded_Sequence</span>&lt;
Variant &gt;<span style=3D'mso-spacerun:yes'>&nbsp; =
</span>{<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-indent:.5in'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>public</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>:<o:p></o:p></span></font></=
p>

<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:.5in'><span
class=3DSpellE><span class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>typedef</span></font></span></span><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq_var</span> _<span =
class=3DSpellE>var_type</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:.5in'><span =
class=3DGramE><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>inline</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span>() {}<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>inline</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span>(const <span =
class=3DSpellE>VariantSeq</span>&amp;
_s)<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in;text-indent:.5in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>: _<span
class=3DSpellE>CORBA_Unbounded_Sequence</span>&lt; Variant &gt; (_s) =
{}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>inline</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span>(_<span =
class=3DSpellE>CORBA_ULong</span> _max)<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in;text-indent:.5in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>: _<span
class=3DSpellE>CORBA_Unbounded_Sequence</span>&lt; Variant &gt; (_max) =
{}<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:.5in'><span =
class=3DGramE><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>inline</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span>(_<span =
class=3DSpellE>CORBA_ULong</span> _max, _<span
class=3DSpellE>CORBA_ULong</span> _<span class=3DSpellE>len</span>, =
Variant* _<span
class=3DSpellE>val</span>, _<span class=3DSpellE>CORBA_Boolean</span> =
_<span
class=3DSpellE>rel</span>=3D0)<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in;text-indent:.5in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>: _<span
class=3DSpellE>CORBA_Unbounded_Sequence</span>&lt; Variant &gt; (_max, =
_<span
class=3DSpellE>len</span>, _<span class=3DSpellE>val</span>, _<span =
class=3DSpellE>rel</span>)
{}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span style=3D'mso-spacerun:yes'>&nbsp; =
</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:.5in'><span =
class=3DGramE><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>inline</span></font></span><=
font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>VariantSeq</span>&amp; operator =3D (const <span =
class=3DSpellE>VariantSeq</span>&amp;
_s) {<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in;text-indent:.5in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>_<span
class=3DSpellE>CORBA_Unbounded_Sequence</span>&lt; Variant <span =
class=3DGramE>&gt;
:</span>:operator=3D(_s);<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in;text-indent:.5in'><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>return</span></font></span><font size=3D2 face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> =
*this;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>}<o:p></o:p></span></font></=
p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>};<o:p></o:p></span></font><=
/p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>This produces a type that =
is functionally
the same as:<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 </span><span
class=3DSpellE><span class=3DGramE>typedef</span></span> _<span =
class=3DSpellE><span
style=3D'mso-bidi-font-style:italic'>CORBA_Unbounded</span>_Sequence</spa=
n>&lt;
Variant &gt; <span =
class=3DSpellE>VariantSeq</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>although</span></font></span=
><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> the <span
class=3DSpellE>VariantSeq</span> produced by IDL is a distinct type in =
c++.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>The only difference this =
creates is that
two IDL <span class=3DSpellE>typedefs</span> to the same type are =
distinctly
different in the typing system of c++.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Example =
IDL:<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 </span><span
class=3DSpellE><span class=3DGramE>typedef</span></span> =
sequence&lt;Variant&gt; <span
class=3DSpellE>VariantSeq</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 </span><span
class=3DSpellE><span class=3DGramE>typedef</span></span> =
sequence&lt;Variant&gt; <span
class=3DSpellE>AnotherSeq</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>This IDL produces two =
distinctly
different, yet functionally the same, c++ =
types.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'tab-stops:63.0pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Is this a requirement of =
the CORBA
mapping, or some other requirement? If it is, does anyone know the =
reason for
it?<o:p></o:p></span></font></p>

</div>

</body>

</html>
=00
------_=_NextPart_001_01C26B31.07A32E65--