[omniORB] another module/namespace question

David Riddoch djr@orl.co.uk
Thu, 14 Jan 1999 09:20:02 +0000 (GMT)


David,

When you #include an IDL file the compiler makes the assumption that you
will also compile that file separately (to generate interface1.hh etc.).
It will not produce stub code for the IDL in included files.

To achieve a (partial) solution you could run the C pre-processor over
master.idl yourself, remove the file and line number information (using
sed or something) and IDL compile the result. I think this would be a lot
less work than modifying the compiler yourself.

David


On Wed, 13 Jan 1999, David Byron wrote:

> As my search for namespace-aware compilers continues, it appears there
> are (at least) three levels of namespace support:
> 
> 1. none
> 2. as long as the contents of a namespace are declared in exactly one file
> 3. namespace declarations work even if they in multiple files
> 
> I'm working with a compiler that falls into category 2 (MetaWare High
> C/C++ 4.0a), so I figured I'd structure my IDL files as follows:
> 
> master.idl
> ----------
> module my_module
> {
> #include <interface1.idl>
> #include <interface2.idl>
> #include <interface3.idl>
> ...
> };
> 
> instead of having module my_module inside each IDL file.
> 
> I figured omniidl would create a stub file master.hh with something like:
> 
> _CORBA_MODULE my_module
> _CORBA_MODULE_BEG
> 
> #include <interface1.hh>
> #include <interface2.hh>
> #include <interface3.hh>
> ...
> 
> _CORBA_MODULE_END
> 
> Unfortunately, the actual master.hh that's generated looks something like:
> 
> #include <interface1.hh>
> #include <interface2.hh>
> #include <interface3.hh>
> 
> _CORBA_MODULE my_module
> _CORBA_MODULE_BEG
> 
> _CORBA_MODULE_END
> 
> Is my solution a valid one?  Should I change the IDL compiler to do
> what I want?
> 
> Thanks for your help.
> 
> -DB
> ---
> David Byron                     dbyron@coactive.com
> Coactive Networks, Inc.         http://www.coactive.com
> 4000 Bridgeway, Suite 303       voice:(415)289-1722
> Sausalito, CA  94965            fax:(415)289-1320
> 
> 
>