[omniORB] How to convert an object reference to a servant?

Tim Theisen ttheisen at tomotherapy.com
Wed Sep 20 10:57:58 BST 2006


In the example given below.  You can easily call getBalance() with the
Account_ptr.
 
double balance = account->getBalance();
 
I don't see any need to get an Account_I *.

...Tim
--
       Tim Theisen                     Lead Research Software Engineer
Phone: +1 608 824 2848                 TomoTherapy Incorporated
  Fax: +1 608 824 2996                 1240 Deming Way
  Web: http://www.tomotherapy.com <http://www.tomotherapy.com/>
Madison, WI 53717-1954 



 

________________________________

From: omniorb-list-bounces at omniorb-support.com
[mailto:omniorb-list-bounces at omniorb-support.com] On Behalf Of Tuyen
Chau
Sent: Tuesday, September 19, 2006 15:29
To: JHJE (Jan Holst Jensen)
Cc: OmniOrb
Subject: Re: [omniORB] How to convert an object reference to a servant?


Since I didn't make myself very clear in the topic, let me give you an
example this time.  Consider this IDL,

interface Account {
    double getBalance();
    ...
};

interface BankManager {
    Account getAccount( in string name );

    void deleteAccount( in account);
};

The implementation that I'm having trouble with is deleteAccount().  The
C++ code looks something like this,

void BankManager_I::deleteAccount( Account_ptr account )
{
    //
    // Here I want to access the "account" implementation.  How do I do
it?
    // Somehow I will need to convert Account_ptr to (Account_I *)
    //
    Account_I *account_i;
    .....
}

As you can see in the code above, I would like to be able to get access
to the implementation of the "account" object, passed in from the
client.  How do I do that?  Orbix provides the _deref() function to do
this, and I'm hoping there is a way to do it in omniORB, but so far I'm
not successful.  Is this an unusual case for the IDL, ie. you shouldn't
allow clients to pass in an object reference as a parameter?

Thanks again for any information that you can provide,
Tuyen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060920/f98dd1c3/attachment.htm


More information about the omniORB-list mailing list