ic and modules

Niclas Eklund nick@REDACTED
Tue Sep 19 08:50:52 CEST 2000


On Mon, 18 Sep 2000, =?ISO-8859-1?Q?Bj=F6rn Wingman?= wrote:

> I'm using modules and includes in my idl files, like this:
> 
> #include "types.idl"
> 
> module Foo
>   interface Bar
>    {
>      myType returnStuff(); // myType declared in types.idl
>    };
> };
> 
> In R6B I had to manually merge types.idl with the other idl files, but
> in R7A (with ic 4.0.4) includes seem to work.
> 
> However, the oe_register/0 functions in the generated code doesn't
> include any orber_ifr:'Repository_create_module' call for the top
> module (Foo, in this case), like the code generated with the old ic
> from R6B and the merged idl-files. It looked like this with the old
> ic:
> 
> OE_1 = orber_ifr:'Repository_create_module'(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"),
> 
> instead, there is this call:
> 
> OE_1 = oe_get_top_module(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"),
> 
> which fails, because the module foo isn't registered.
> 
> How do I tell ic to generate code to register a top module entry in
> the ifr? Is there some option that I haven't found?

Hello!

The function oe_get_top_module was added to allow users to define multiple
module definitions. For example:

// File A.idl
module M {
    interface I
       {
	...
	};
};


// File B.idl
module M {
    interface J
       {
        ... 
        }; 
};
         

The function oe_get_top_module looks like:
 
oe_get_top_module(OE_IFR, ID, Name, Version) ->
  case orber_ifr:'Repository_lookup_id'(OE_IFR, ID) of
    [] ->
      orber_ifr:'Repository_create_module'(OE_IFR, ID, Name, Version);
    Mod  ->
      Mod
   end.


Hence, if module M not have been registered before it will be created,
otherwise the existing definition will be used.

Have you registered the included IDL-file as well (i.e. types.idl)?
If you look in the oe_XXX file the function include_reg_test/1 states
which file you must register first. 

/Nick






More information about the erlang-questions mailing list