[omniORB] Echo *echoPtr vs. Echo_ptr echoPtr

Duncan Grisby dgrisby@uk.research.att.com
Tue, 24 Oct 2000 10:37:32 +0100


On Monday 23 October, Janet Tvedt wrote:

> I am in the process of upgrading from omniORB version 2.8.0
> to version 3.0.2.  I am wondering why pointer declarations
> no longer work.  What is the fundamental difference between
> Echo *echoPtr and Echo_ptr echoPtr?

The CORBA specification has always said that Echo_ptr is the only
valid type to use for an object reference (and Echo_var, of course).
It just so happened that in omniORB 2, and most other BOA-based ORBs,
Echo_ptr was the same as Echo*, but that was just an implementation
detail. It is no longer the case in omniORB 3, and most other
POA-based ORBs.

There is no work-around for non-compliant code which uses Echo*. I'm
afraid you will have to change all uses of Echo* to Echo_ptr.

> I ask because I am porting lots of code that uses the * version
> and a general name resolution template function that has a
> parameter Type ** as shown below: 
>    template <class Type> 
>    int getCosNamingObjectRef(Type **a, ...

For this sort of thing, it's not as bad as it might be, because the
C++ mapping helps out. You can use:

    template <class Type> 
    int getCosNamingObjectRef(Type::_ptr_type *a, ...

Since the C++ mapping says that for interface I, I::_ptr_type is a
typedef to I_ptr. You won't have to change all calls to the template
function, just the declarations of the object reference variables you
pass to it.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --