[orbitcpp-list] Re: orbitcpp-list digest, Vol 1 #177 - 1 msg
Status: Beta
Brought to you by:
philipd
From: John L. <jk...@lu...> - 2001-03-07 23:06:30
|
> Message: 1 > Date: Wed, 7 Mar 2001 14:23:46 +0100 > From: MHL...@t-... (Martin Schulze) > To: orb...@li... > Subject: Re: [orbitcpp-list] support for sequence<any> broken in orbitcpp-0.30 > Reply-To: orb...@li... [...] > 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); > } > [...] > 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. > Hey everybody. About a month ago I took a job with Handheld Products, A Welch Allyn Affiliate so with that and personal issues I have been unable to do anything with orbitcpp :-(. Anyway, I believe the code as it stands is correct. Referring to page 1-52 to 1-54 of the CORBA C++ spec, there must be a copying and a non-copying form of inserter. The non-copying form means that the Any assumes ownership of the object reference, or structure, and the caller of the inserter should not use the structure ever again, so this implies the use of a non-const pointer. In fact, an Any implementation can destroy the passed structure and recreate it somewhere else if it so desires. Making this emit const* would violate compliance I believe. John |