[omniORB] abstract class

Näwe, Stefan stefan.naewe at atlas-elektronik.com
Thu Mar 5 15:57:44 GMT 2009


 

> -----Original Message-----
> From: omniorb-list-bounces at omniorb-support.com 
> [mailto:omniorb-list-bounces at omniorb-support.com] On Behalf 
> Of Clarke Brunt
> Sent: Thursday, March 05, 2009 3:07 PM
> To: omniorb-list at omniorb-support.com
> Subject: RE: [omniORB] abstract class
> 
> > My omniidl gives me the following declarations for the _get/_set
> functions:
> >
> >    virtual ::CORBA::Char get_char(::CORBA::UShort index) = 0;
> >    virtual ::CORBA::Double get_double(::CORBA::UShort index) = 0;
> >    virtual void set_char(::CORBA::Char c, ::CORBA::UShort 
> index) = 0;
> >    virtual void set_double(::CORBA::Double d, 
> ::CORBA::UShort index) = 0;
> >
> >
> > Look Ma, no underscores!
> 
> Well spotted! Those underscores evidently escaped the eyes of 
> both myself
> and Wernke. The original poster solved the problem (either by getting
> omniidl to generate the examples, or by examining the 
> definitions in the
> generated header), but didn't actually say it was that was 
> wrong before.
> 
> Some compilers/linkers add underscores, don't they? I wonder 
> if perhaps some
> previous error messages included the '_', and caused confusion.

I just read the CORBA Spec (CORBA-3.0-04-03-12.pdf). It says in §3.2.3.1:

<quote>
...
To minimize the amount of work, users may lexically “escape” identifiers by
prepending an underscore (_) to an identifier. This is a purely lexical convention that
ONLY turns off keyword checking. The resulting identifier follows all the other rules
for identifier processing. For example, the identifier _AnIdentifier is treated as if it
were AnIdentifier.
The following is a non-exclusive list of implications of these rules:
• The underscore does not appear in the Interface Repository.
• The underscore is not used in the DII and DSI.
• The underscore is not transmitted over “the wire.”
• Case sensitivity rules are applied to the identifier after stripping off the leading
underscore.
For example:
module M {
   interface thing {
      attribute boolean abstract; // error: abstract collides with
                                  // keyword abstract
      attribute boolean _abstract; // ok: abstract is an identifier
};
};
...
</quote>

Everything explained...

Stefan


More information about the omniORB-list mailing list