[omniORB] Standard ?

Dietmar May dcmay@object-workshops.com
Wed, 8 Apr 1998 17:14:50 -0400


Boris,

> 1.
> I think most idl compilers will compile
> this
> interface A
> {
>  void foo( void );
> }
>
> into
> void A::foo( Enviroment & )
>
> OMNI does it like this
> void A::foo( void )
>
> Should it be Enviroment here?

The Environment parameter is an optional value, required only for those 
ORB implementations which support compilers that don't handle C++ 
exceptions. omniORB uses C++ built-in exception handling on all of the 
platforms (to the best of my knowledge), and therefore does not need an 
Environment variable. The use of Environment is ORB-dependent (see CORBA 
2.1 sec 16.17 p16-45).

We use a couple of macros to handle this portably:

#define CENV_DECL   Environment& =(*some ORB default value*)
#define c_CENV_DECL , Environment& =(*some ORB default value*)
#define CENV_IMPL   Environment&
#define c_CENV_IMPL , Environment&

where *some ORB default value* is CORBA::IT_chooseDefaultEnv() on Orbix.

Regards,
Dietmar May