Discussion:
[omniORB] Is it possible to narrow to a local implementation?
Ramón Talavera
2014-09-23 17:20:21 UTC
Permalink
I hope this does not sound too weird or basic.

Is it possible to 'narrow' a _ptr or _var instance to a concrete
implementation, I mean, obtain the real implementation of the
wrapped-around-by-corba so that I communicate with it through the 'local'
interface?

For example:

AImp is-a CorbaObject that implements CA , it contains a public method mX()
NOT present in the IDL.

AImp *a=new AImp(ORB);
a.mX(); // perfectly possible due to being AImp


... later, in another method, and in the same machine:

CA_ptr ca= get a corba reference to a by narrowing.
ca.mX(); // illegal, mX() is not part of the IDL

AImp *a=(AImp*) (ca->_get_Implementation()); // cannot make this to compile


Is _get_Implementation() suppossed to do what I am trying to archieve? Is
it even possible to access the real wrapped implementation when local to
the object?

Thanks in advance.
Ram?n Talavera
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20140923/5573701a/attachment.html>
Luke Deller
2014-09-23 23:11:45 UTC
Permalink
Hi Ram?n,
Is it possible to 'narrow' a _ptr or _var instance to a concrete implementation, I mean, obtain the real implementation of the wrapped-around-by-corba so that I communicate with it through the 'local' interface?
This only makes sense within the same process that hosts the CORBA object. It can be done by calling a method of the POA called reference_to_servant.

Regards,
Luke.
**********************************************************************************************
Important Note
This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Limited.

It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.
IRESS Limited does not warrant that the information is free of a virus or any other defect or error.
**********************************************************************************************
Loading...