Getting the implementation object from a reference

Steve Brenneis brenneis@SURRY.NET
Wed, 04 Mar 1998 19:43:35 -0500


I would suggest using _narrow and then test the result using =
CORBA::is_nil.  If it is not nil then a static or C-style cast would be =
safe.

As a side note, it will be nice when all compilers support RTTI and =
dynamic casting.  It should simplify the implementation of _narrow =
significantly.

----------
From: 	Ole Storm
Sent: 	Wednesday, March 04, 1998 7:34 AM
To: 	omniorb-listorlcouk
Subject: 	Getting the implementation object from a reference

Greetings,

Having a reference to a CORBA object, I would like to get the associated
implementation object. I am aware that I can use dynamic casting:

   Interface_i *p =3D dynamic_cast<Interface_i*>(i_ptr);
   if(p)
     // ok to use p...

- but what do I do with compilers that do not support run-time type
information??


Regards,

	Ole.

---------------------------------------------------------------
Ole Storm
The Institute of Applied Computer Science (IFAD)
Forskerparken 10, DK-5230 Odense M, Denmark
Phone: +45 6315 7134, Fax: +45 6593 2999, Email: storm@ifad.dk
WWW: http://www.ifad.dk
---------------------------------------------------------------