I am sorry about PRF<br><br>TAO VERSION: 1.5.8<br>ACE VERSION: 5.5.8<br><br>HOST MACHINE:<br>any<br><br><div><span class="gmail_quote">On 6/13/07, <b class="gmail_sendername">Douglas C. Schmidt</b> &lt;<a href="mailto:schmidt@dre.vanderbilt.edu">
schmidt@dre.vanderbilt.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Vikram,<br><br>As always, to ensure that we have proper version/platform/compiler
<br>information, please make sure you fill out the appropriate problem<br>report form (PRF), which is in<br><br>$ACE_ROOT/PROBLEM-REPORT-FORM<br>$TAO_ROOT/PROBLEM-REPORT-FORM<br><br>or in<br><br>$ACE_ROOT/BUG-REPORT-FORM<br>
$TAO_ROOT/BUG-REPORT-FORM<br><br>in older versions of ACE+TAO.&nbsp;&nbsp;Make sure to include this information<br>when asking any questions about ACE+TAO since otherwise we have to<br>&quot;guess&quot; what version/platform/compiler/options you&#39;ve using, which is
<br>very error-prone and slows down our responsiveness.&nbsp;&nbsp;If you don&#39;t use<br>the PRF, therefore, it is less likely that someone from the core<br>ACE+TAO developer team will be able to answer your question.<br>Naturally, we encourage and appreciate other members of the ACE+TAO
<br>user community who can respond to questions that they have the answers<br>to.<br><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;i have a sample application where in the &quot;int main&quot; mathod i am creating<br>&gt;ORB by using ORB_init.<br><br>Ok.<br>
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;Now that variable is local to &quot;int main&quot;, i don&#39;t want to make it<br>&gt;global, but i want to get its reference in some other method say &quot;int xyz&quot;.<br><br>Ok.<br><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;In my previous ORB they were having CORBA::ORB::_duplicate () to return
<br>&gt;reference to the global ORB.<br><br>That is non-standard behavior.<br><br>&gt;But TAO does not have _duplicate with no<br>&gt;parameters, means we have to pass ORB reference to be duplicated.<br><br>Right, that is standard behavior.
<br><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;Is there any way to have this work?<br><br>Sure - either<br><br>. Pass the (duplicated) ORB as a parameter to int xyz()<br><br>. Create a singleton called MySingletonORB and use this everywhere.</blockquote>
<div><br>Ok thankx, let me add few more complications.<br>I am writing a template class who will create object reference. it has a URL private member witch has corbaloc of the remote object. now i want to use this template in my two different applications both of them use different orbs.
<br><br>template &lt;class TRef, class TRef_var&gt; void CliInfo&lt;TRef, TRef_var&gt;::createObjectRef ()<br>{<br>&nbsp;&nbsp;&nbsp; if (!CORBA::is_nil (m_objRef.in ())) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; try {<br><br>//// In this next statement i need orb
<br>//// now i can not hard code orb as this name may change in different applications.<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CORBA::Object_var obj = _orb -&gt; string_to_object (m_url);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!CORBA::is_nil (obj)) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_objRef = TRef::_narrow (obj);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TBD: throw exception<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; } catch (...) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TBD: throw exception<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>One option is to pass orb parameter to this object through constructor means it will use _duplicate and store a reference to orb. different applications will pass different orb object through constructor.
<br>now my concern is, any application can have many such CliInfo objects, duplicating ORB reference in every such object will it increase memory utilisation? and if suppose i want to destory orb and recreate it i must tell all these objects to yield the reference and i again assign newly initiated ORB reference.
<br><br>what would be the other approach?<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">take care,<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Doug<br>--<br>
Dr. Douglas C. Schmidt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Professor and Associate Chair<br>Electrical Engineering and Computer Science&nbsp;&nbsp;TEL: (615) 343-8197<br>Vanderbilt University&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WEB: <a href="http://www.dre.vanderbilt.edu/~schmidt">
www.dre.vanderbilt.edu/~schmidt</a><br>Nashville, TN 37203&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NET: <a href="mailto:d.schmidt@vanderbilt.edu">d.schmidt@vanderbilt.edu</a><br></blockquote></div><br><br clear="all"><br>-- <br>________________________________________________________________
<br>&quot;Science is a wonderful thing if one does not have to earn one&#39;s living at it.&quot; -- Einstein.<br><br>- Vikram Karandikar