Re: ORBit order dependence within idl files?



Todd Graham Lewis <tlewis@mindspring.net> writes:
> In the transaction section of the CORBA services document, they define
> several inter-referential IDL specs for transaction services.  Trying to
> get them to compile to C files under ORBit, I have discovered something of
> a problem.  I've culled the idl down to the bare essentials to illustrate
> the problem; if anyone is interested in the full idl, then let me know
> and I'll mail it to you.  (I just transcribed it from the spec.)
> 
> bar.idl:
> *****
> interface Coordinator {
> 
>    void register_subtran_aware(in SubtransactionAwareResource r)
>       raises(Inactive, NotSubtransaction);
> 
> };
> 
> interface SubtransactionAwareResource : Resource {
>         void commit_subtransaction(in Coordinator parent);
>         void rollback_subtransaction();
> };
> *****
> 
> Notice that A references B and B references A.
> 
> ORBit does not like this, to wit:
> 
> 	reflections% orbit-idl -d2 bar.idl
> 	bar.idl:3 `SubtransactionAwareResource' undeclared identifier

And here's what MICO says:

  sejong $ idl bar.idl 
  bar.idl:3: scoped name 'SubtransactionAwareResource' not defined

and here's what Orbix has to say:

  sejong $ /opt/Orbix_2.2MT/bin/idl bar.idl
  3:(semantic): Identifier `SubtransactionAwareResource' not found 
  3:(semantic): Name does not denote a type 
  4:(semantic): Identifier `Inactive' not found 
  4:(semantic): Identifier `NotSubtransaction' not found 
  8:(semantic): Identifier `Resource' not found 

> I'm presuming that since this came from an OMG spec that it's legal
> CORBA, but it's impossible for me to tell.  

But a random fragment may not be a full-fledged IDL definition.
This just requires a forward declaration of one of the interfaces.  Just
add

	interface SubtransactionAwareResource;

at the beginning.  With this, the messages are:

  sejong $ /opt/Orbix_2.2MT/bin/idl bar.idl
  6:(semantic): Identifier `Inactive' not found 
  6:(semantic): Identifier `NotSubtransaction' not found 
  10:(semantic): Identifier `Resource' not found 

  sejong $ idl bar.idl                           #mico
  bar.idl:6: scoped name 'Inactive' not defined

  sejong ~/z/z/orbit > orbit-idl -d2 bar.idl
  bar.idl:6 `Inactive' undeclared identifier

(These are of course, real errors in the fragment that you posted).

HTH
- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]