[omniORB] [omniORB3] C++ mapping of out struct parameters

Sergey Volk volk@em.com.by
Tue, 20 Nov 2001 20:50:07 +0200


Hello,
when I tried to compile interface definition which uses out struct
parameters I've got strange code:
parameters map to C++ references, while corresponding T_out type defined as
template, which is incompatible with reference. Here's simple example (I'm
using omniORB 3.0.4 for win32):

SimpleImpl.idl:

interface MyInterface {
    struct MyStruct {
        long l;
        // ...
    };
    void f(out MyStruct s);
};


In compiled code:
//...
typedef _CORBA_ConstrType_Fix_OUT_arg< MyStruct,MyStruct_var > MyStruct_out;
//...
virtual void f(MyInterface::MyStruct& s) = 0;
//...

When I try to implement this interface by inheriting from POA_MyInterface
and defining my function as:
// Such a definition complies to OMG IDL to C++ mapping (99-07-41.pdf)
void f(MyInterface::MyStruct_out s);

Visual C++ 6.0 SP5 says:
MyInterfaceImpl.cpp(17) : error C2259: 'MyInterfaceImpl' : cannot
instantiate abstract class due to following members:
        MyInterfaceImpl.h(3) : see declaration of 'MyInterfaceImpl'
MyInterfaceImpl.cpp(17) : warning C4259: 'void __thiscall
_impl_MyInterface::f(struct My::AAA &)': pure virtual function was not
defined
        MyInterface.hh(170) : see declaration of 'f'

Borland C++ gives similar error message. What's wrong with this example?