[omniORB] converting servant * to objref in BOA
David Riddoch
djr@uk.research.att.com
Thu, 9 Nov 2000 15:52:02 +0000 (GMT)
Andy,
The difference between a servant (object implementation) and object
reference in CORBA is a bit like the difference between an instance of an
class in c++, and a pointer to it.
In c++ you get from an instance to a pointer by taking the address. In
CORBA you get from a servant to an object reference by invoking _this().
Note that you have to activate your object _before_ you can get hold of
its reference. Also in omniORB all servants used with the BOA _must_ be
heap allocated. See the examples in <omniORB>/src/examples/boa/.
Cheers,
David
On Thu, 9 Nov 2000, Andy Faibishenko wrote:
> I have some code which does the following.
>
> I have a class A which I pass into a remote CORBA interface. The code on the remote side then calls back on a method in class A.
>
> I've declared A as follows
>
> class A : public _sk_A
> {
> ...
> }
>
> Then when I call the remote interface, I invoke
> A a;
> remoteObjRef->CallMeBack(&a);
>
> This worked under Visibroker BOA but the OmniOrb3 complains about expecting a _objref_A *. The docs mention OmniOrb requiring objrefs but how do I convert my A * to an objref *. Am I inheriting from the wrong class?
>
> Thanks.
> -Andy
>
> PS I need to port this to OmniOrb BOA not POA.