<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.4630.0">
<TITLE>Arrays in IDL and C++ mapping in OmniORB</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello all,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">While reading the Henning & Vinoski book I found a difference between arrays and their mapping regarding the omniORB mapping.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">In fact, H&V distinguishes the array of fixed-length element and the array of<B> v</B>ariable-<B>l</B>ength (vl) element. </FONT>
<BR><FONT SIZE=2 FACE="Arial">The C++ mapping for servant side is not the same for the vl array.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Consider this IDL:</FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Times New Roman">typedef sequence<long> LongSeq;</FONT>
<BR><FONT SIZE=2 FACE="Times New Roman">typedef double Darr[3]; // array with fixed length element</FONT>
<BR><FONT SIZE=2 FACE="Times New Roman">typedef LongSeq Varr[3]; // array with variable length element</FONT>
<BR><FONT SIZE=1 FACE="Courier New">void darrOp( inout Darr darr_inout) ;</FONT>
<BR><FONT SIZE=1 FACE="Courier New">void varrOp( inout Varr darr_inout) ;</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Courier New">OmniORB (impl and objref) mapping is:</FONT>
<BR><FONT SIZE=1 FACE="Courier New">void darrOp(Darr darr_inout) </FONT>
<BR><FONT SIZE=2 FACE="Courier New">H&R (impl and objref) mapping is:</FONT>
<BR> <FONT SIZE=1 FACE="Courier New">void varrOp(Varr_slice * varr_inout) </FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New">What happen, in OmniORB, if the Varr[0] sequence is reallocated in the servant method implementation ?</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Do OmniORB store only pointers to element in the array ?</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Who is right ?</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Thanks</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Fred</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New"> (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> </FONT><B></B><B> <FONT FACE="Courier New">Frédéric Prin</FONT></B><FONT SIZE=2 FACE="Courier New"> )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Senior Software Engineer /</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> S I L V A C O (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Grenoble REsearch CEnter \</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Tel 04 56 38 10 33 )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> __________________________/___</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/_____/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
</P>
</BODY>
</HTML>