Discussion:
[omniORB] Value Box issue
Josh Arnold
2007-06-14 23:48:16 UTC
Permalink
Hello,

I'm having a problem with the C++ header generated for ValueBox types. For
example, using the following IDL:

module org {
module omg {
module boxedRMI {

valuetype seq1_boolean sequence<boolean>;

#pragma ID seq1_boolean "RMI:[Z:0000000000000000"

};
};
};

The generated class has the following declaration:

static seq1_boolean* _downcast(ValueBase*);

The problem is ValueBase should be scoped to the CORBA namespace, as in:

static seq1_boolean* _downcast(CORBA::ValueBase*);

I believe the underlying problem is on line 836 of
src/lib/omniORB/omniidl_be/cxx/value.py. It appears to still be an issue in
the latest development stream.

Note that the generated stub does use the correct namespace for the function
definition:

org::omg::boxedRMI::seq1_boolean*
org::omg::boxedRMI::seq1_boolean::_downcast(CORBA::ValueBase* _b)
{
return _b ? (org::omg::boxedRMI::seq1_boolean*)_b->_ptrToValue(_PD_repoId)
: 0;
}


Thanks,
- Josh Arnold

_________________________________________________________________
Don’t miss your chance to WIN $10,000 and other great prizes from Microsoft
Office Live http://clk.atdmt.com/MRT/go/aub0540003042mrt/direct/01/
Duncan Grisby
2007-06-15 15:48:49 UTC
Permalink
Post by Josh Arnold
I'm having a problem with the C++ header generated for ValueBox types.
[...]
Post by Josh Arnold
static seq1_boolean* _downcast(ValueBase*);
static seq1_boolean* _downcast(CORBA::ValueBase*);
You're right that ValueBase should be scoped. However, your C++ compiler
is broken if it doesn't accept the unscoped form, since the class is
derived from CORBA::DefaultValueRefCountBase, which is derived from
CORBA::ValueBase. The compiler should pick up ValueBase from the
inheritance.

Regardless, I've fixed the omniidl output to include the CORBA::
qualification.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...