Re[4]: [omniORB] Reopening namespace - the complete solution

Duncan Grisby dgrisby@uk.research.att.com
Mon, 21 Feb 2000 12:30:03 +0000


On Monday 21 February, Alex Shabarshoff wrote:

> DG> // C.idl
> DG> #define NAMESPACE_OPENED
> DG> module M {
> DG> #include "A.idl"
> DG> #include "B.idl"
> DG> };
> 
> DG> then the repository ids of I1 and I2 should be IDL:I1:1.0 and
> DG> IDL:I2:1.0, without the M.
> 
> Hmm... I don't understand why? After the preprocessor the output would
> be:
> 
> module M {
> interface I1 ...
> interface I2 ...
> };
> 
> So, the repoID's should be IDL:M/I1:1.0 and IDL:M/I2:1.0 or they
> don't?

See section 10.6.5.2 of the CORBA 2.3 spec. It explains the rules
about how repository IDs are generated. One of the examples it gives
is

// E.idl
interface E {};

// F.idl
module M {
#include "E.idl"
};

And says that E's repoId is IDL:E:1.0.

Many IDL compilers get this wrong, in various unexpected ways. It is
extremely dangerous to use #include anywhere other than at global
scope if you wish to use more than one ORB.

Cheers,

Duncan.

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