[omniORB] Ties failure with MSVC

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Fri, 8 Sep 2000 10:29:05 +0200


Hi all,
    I just discovered that on v. 2.8, MSVC 6.0 sp3, no tie constructor with
an explicit object key can be used.
Say we have this simple test snapshot for an interface Foo:

namespace SomeModule {

class _sk_Foo {
public:
    _sk_Foo() {}
    _sk_Foo(const omniORB::objectKey& key) {}
};
class SomeClass {
};

template <class T, CORBA::Boolean release>
class _tie_Foo: public virtual SomeModule::_sk_Foo {
public:
    _tie_Foo(T *t, const omniORB::objectKey& key): SomeModule::_sk_Foo(key)
{}
};

then we have the following implementation code:

    ...
    SomeClass *x;
    _tie_Foo<SomeClass, false> *t = new _tie_Foo<SomeClass, false>(x, key);

MSVC says '_sk_Foo' : already initialized' on the above tie constructor.
If we replace it by:

    _tie_Foo(T *t, const omniORB::objectKey& key): _sk_Foo(key) {}    //
SomeModule removed

all compiles fine.
Yes, I know it is not an OmniORB fault, I just wonder if anyone else on this
list met this problem before.
I think a simple workaround is to use diamond inheritance to initialize the
skeleton through a parallel branch,
since the first key passed to a skeleton does the job.
Thanks,
                                             Renzo Tomaselli
---------------------------------------------------------------------------
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
---------------------------------------------------------------------------