[Ace-users] Re: [tao-users] Reference to ORB

Vikram Karandikar softking at gmail.com
Wed Jun 13 05:58:11 CDT 2007

I am sorry about PRF



On 6/13/07, Douglas C. Schmidt <schmidt at dre.vanderbilt.edu> wrote:
> Hi Vikram,
> As always, to ensure that we have proper version/platform/compiler
> information, please make sure you fill out the appropriate problem
> report form (PRF), which is in
> or in
> in older versions of ACE+TAO.  Make sure to include this information
> when asking any questions about ACE+TAO since otherwise we have to
> "guess" what version/platform/compiler/options you've using, which is
> very error-prone and slows down our responsiveness.  If you don't use
> the PRF, therefore, it is less likely that someone from the core
> ACE+TAO developer team will be able to answer your question.
> Naturally, we encourage and appreciate other members of the ACE+TAO
> user community who can respond to questions that they have the answers
> to.
> >    i have a sample application where in the "int main" mathod i am
> creating
> >ORB by using ORB_init.
> Ok.
> >    Now that variable is local to "int main", i don't want to make it
> >global, but i want to get its reference in some other method say "int
> xyz".
> Ok.
> >    In my previous ORB they were having CORBA::ORB::_duplicate () to
> return
> >reference to the global ORB.
> That is non-standard behavior.
> >But TAO does not have _duplicate with no
> >parameters, means we have to pass ORB reference to be duplicated.
> Right, that is standard behavior.
> >    Is there any way to have this work?
> Sure - either
> . Pass the (duplicated) ORB as a parameter to int xyz()
> . Create a singleton called MySingletonORB and use this everywhere.

Ok thankx, let me add few more complications.
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

template <class TRef, class TRef_var> void CliInfo<TRef,
TRef_var>::createObjectRef ()
    if (!CORBA::is_nil (m_objRef.in ())) {

    try {

//// In this next statement i need orb
//// now i can not hard code orb as this name may change in different

        CORBA::Object_var obj = _orb -> string_to_object (m_url);
        if (!CORBA::is_nil (obj)) {
            m_objRef = TRef::_narrow (obj);
        } else {
            // TBD: throw exception
    } catch (...) {
        // TBD: throw exception

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.
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.

what would be the other approach?

take care,
>      Doug
> --
> Dr. Douglas C. Schmidt                       Professor and Associate Chair
> Electrical Engineering and Computer Science  TEL: (615) 343-8197
> Vanderbilt University                        WEB:
> www.dre.vanderbilt.edu/~schmidt
> Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu

"Science is a wonderful thing if one does not have to earn one's living at
it." -- Einstein.

- Vikram Karandikar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/ace-users/attachments/20070613/3f75b342/attachment.htm

More information about the Ace-users mailing list