[omniORB] _narrow problems with VAC++ 5.0 on AIX

Peter Ledbrook p.ledbrook@psenterprise.com
Tue, 01 Aug 2000 17:01:20 +0100


OK, I've now solved the problem but I am not too sure why it didn't work :-)

Imagine this scenario:

Interface A
Interface B : A
Interface C : B
Interface D : C,B
Interface E : D

Nice and simple :-) Now consider two implementation classes:

class B_i : public virtual _sk_B {}

class E_i : public virtual _sk_E, public virtual B_i {}

This second declaration is the one causing the problems. An object created of
type E_i will not work with _narrow correctly. So, if you try to narrow a
CORBA::Object of type E_i to the correct object reference,
_widenFromTheMostDerivedIntf will be called as if the object is type A rather
than type E. To fix this problem, the virtual keywords need to be removed from
the declaration for E:

class E_i : public _sk_E, public B_i {}

I really don't know whether this is a problem with the compiler or not. I am
still trying to replicate the problem on a small scale, perhaps for a bug
report.

Peter

--
Product Development Engineer
Process Systems Enterprise Ltd.

Bridge Studios,
107a Hammersmith Bridge Road,
London
W6 9DA

Tel: +44 20 8563 0888   Fax: +44 20 8563 0999

mailto:p.ledbrook@psenterprise.com
website: http://www.psenterprise.com