Re[2]: [omniORB] Reopening namespace - the complete solution
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 21 Feb 2000 11:19:13 +0000
On Friday 18 February, Alex Shabarshoff wrote:
> Of cause. But the idea was if you have two idl files with _same_
> module, you can "shield" the module keyword in defines. Let's look at
> more complex example:
>
> A.idl:
> #ifndef NAMESPACE_OPENED
> #define NAMESPACE_OPENED
> #define NAMESPACE_ROOT_A
> module M { // here namespace begins
> #endif
>
> interface I1 {};
>
> #ifdef NAMESPACE_ROOT_A
> }; // here namespace ends
> #endif
> #endif
>
> B.idl:
> #ifndef NAMESPACE_OPENED
> #define NAMESPACE_OPENED
> #define NAMESPACE_ROOT_B
> module M { // here namespace begins
> #endif
>
> interface I2 {};
>
> #ifdef NAMESPACE_ROOT_B
> }; // here namespace ends
> #endif
> #endif
>
> So, the repository id's will be IDL:M/I1:1.0 and IDL:M/I2:1.0. I know
> this is silly to use defines, but Sun's idl2java gets wild then you
> reopen namespace (omniidl2 does not :).
But my point is that if you now try to put everything in a single
module, like:
// C.idl
#define NAMESPACE_OPENED
module M {
#include "A.idl"
#include "B.idl"
};
then the repository ids of I1 and I2 should be IDL:I1:1.0 and
IDL:I2:1.0, without the M.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --