Re: [orbitcpp-list] support for sequence<any> broken in orbitcpp-0.30
Status: Beta
Brought to you by:
philipd
|
From: <MHL...@t-...> - 2001-03-07 13:21:40
|
On Sam, 03 Mär 2001 18:02:50 Martin Schulze wrote:
> Hi!
>
> orbitcpp-0.30 works just perfectly with orbit-0.5.7
> (good work !) but mayby you also want to tackle down this:
>
> - It doesn't build on top of orbit-mt-0.5.7:
> [snip]
Okay so this works with Sam's patches applied, except that
test 'everything' fails at 'transient object destruction'.
> - The support for predefined CORBA-sequences is broken:
>
> Try to compile the output 'orbit-idl -lc++' produces
> from the following idl-code:
>
> module CorbaSigC
> {
> typedef sequence<any> ParamList;
>
> interface Slot {
> any call( in ParamList params );
> };
> };
>
A simple workaround for this problem, as I now found out,
is to put a remark around three lines in orb/corba_sequences.h:
[...]
/*#define _CORBA_sequence_CORBA_any_defined
typedef struct CORBA_sequence_CORBA_any_struct CORBA_AnySeq;
typedef struct CORBA_sequence_CORBA_any_struct CORBA_sequence_CORBA_any;*/
[...]
Another problem I experienced with orbitcpp-0.30 lies in the
declaration of the i/o-operators for CORBA::Any that are created
in [name]-cpp-common.hh when you define a struct or interface in
[name]-idl:
For the above example orbit-idl -lc++ would create in
CorbaSigC-cpp-common.hh:
[...]
inline void operator<<=(CORBA::Any& the_any, ::CorbaSigC::Slot_ptr* val) {
the_any.insert_simple( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
val, CORBA_FALSE);
}
inline void operator<<=(CORBA::Any& the_any, ::CorbaSigC::Slot_ptr val) {
the_any.insert_simple( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
&val);
}
inline CORBA::Boolean operator>>=(const CORBA::Any& the_any,
::CorbaSigC::Slot_ptr& val) {
return the_any.extract( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
val);
}
[...]
but it has to be something like:
[...]
namespace CorbaSigC {
inline void operator<<=(CORBA::Any& the_any, ::CorbaSigC::Slot_ptr
const * val) { // <---- const Pointer !!!
the_any.insert_simple( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
val, CORBA_FALSE);
}
inline void operator<<=(CORBA::Any& the_any, ::CorbaSigC::Slot_ptr
val) {
the_any.insert_simple( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
&val);
}
inline CORBA::Boolean operator>>=(const CORBA::Any& the_any,
::CorbaSigC::Slot_ptr& val) {
return the_any.extract( (CORBA::TypeCode_ptr)&::_orbitcpp::c::TC_CorbaSigC_Slot_struct,
val);
}
}
[...]
I attached a simple patch for orbitcpp-0.30 that lets
orbitcpp create the latter code. Please check whether it's
okay and if so feel free to commit to cvs.
Cu,
Martin.
|