implementation question in corba transport

I'm making sure that the beta2 builds on OmniORB.

To do that, I need to change the following pattern (which appears quite
a few times)

const TypeInfo* ti = <get typeinfo>
CorbaTypeTransporter* ctt = <get transport>
CORBA::Any_var any = <create any>
args[i] = *any;

where args is a sequence of anys.

It is once mentioned that this line is supposed to make a copy.
Unfortunately the * operator to Any_var seems to be nonstandard. I
therefore need to know if the copying is really needed. IMO it does not,
as the Any_var will go out of scope (and the Any destroyed) anyway, so
it seems fine to just copy the Any_var with

args[i] = any;

Am I missing something ?

implementation question in corba transport

On Wednesday 21 April 2010 11:01:54 Sylvain Joyeux wrote:
> I'm making sure that the beta2 builds on OmniORB.
>
> To do that, I need to change the following pattern (which appears quite
> a few times)
>
> const TypeInfo* ti = <get typeinfo>
> CorbaTypeTransporter* ctt = <get transport>
> CORBA::Any_var any = <create any>
> args[i] = *any;
>
> where args is a sequence of anys.
>
> It is once mentioned that this line is supposed to make a copy.
> Unfortunately the * operator to Any_var seems to be nonstandard. I
> therefore need to know if the copying is really needed. IMO it does not,
> as the Any_var will go out of scope (and the Any destroyed) anyway, so
> it seems fine to just copy the Any_var with
>
> args[i] = any;

Any available patches I can pull yet ? I just pushed my latest status of
rtt-2.0-mainline to github in case you want to rebase.

Peter

implementation question in corba transport

Peter Soetens wrote:
> On Wednesday 21 April 2010 11:01:54 Sylvain Joyeux wrote:
>
>> I'm making sure that the beta2 builds on OmniORB.
>>
>> To do that, I need to change the following pattern (which appears quite
>> a few times)
>>
>> const TypeInfo* ti = <get typeinfo>
>> CorbaTypeTransporter* ctt = <get transport>
>> CORBA::Any_var any = <create any>
>> args[i] = *any;
>>
>> where args is a sequence of anys.
>>
>> It is once mentioned that this line is supposed to make a copy.
>> Unfortunately the * operator to Any_var seems to be nonstandard. I
>> therefore need to know if the copying is really needed. IMO it does not,
>> as the Any_var will go out of scope (and the Any destroyed) anyway, so
>> it seems fine to just copy the Any_var with
>>
>> args[i] = any;
>>
>
> Any available patches I can pull yet ? I just pushed my latest status of
> rtt-2.0-mainline to github in case you want to rebase.
>
Yes, sorry. I was keeping them under my shoulder as I have other stuff
from my rubim fork to merge as well.

I pushed the harmless patches I have until now to my github's for-peter
branch. There is omniorb fixes + a few modifications to ReadOnlyPointer

implementation question in corba transport

On Thursday 22 April 2010 11:32:57 Sylvain Joyeux wrote:
> Peter Soetens wrote:
> > On Wednesday 21 April 2010 11:01:54 Sylvain Joyeux wrote:
> >> I'm making sure that the beta2 builds on OmniORB.
> >>
> >> To do that, I need to change the following pattern (which appears quite
> >> a few times)
> >>
> >> const TypeInfo* ti = <get typeinfo>
> >> CorbaTypeTransporter* ctt = <get transport>
> >> CORBA::Any_var any = <create any>
> >> args[i] = *any;
> >>
> >> where args is a sequence of anys.
> >>
> >> It is once mentioned that this line is supposed to make a copy.
> >> Unfortunately the * operator to Any_var seems to be nonstandard. I
> >> therefore need to know if the copying is really needed. IMO it does not,
> >> as the Any_var will go out of scope (and the Any destroyed) anyway, so
> >> it seems fine to just copy the Any_var with
> >>
> >> args[i] = any;
> >
> > Any available patches I can pull yet ? I just pushed my latest status of
> > rtt-2.0-mainline to github in case you want to rebase.
>
> Yes, sorry. I was keeping them under my shoulder as I have other stuff
> from my rubim fork to merge as well.
>
> I pushed the harmless patches I have until now to my github's for-peter
> branch. There is omniorb fixes + a few modifications to ReadOnlyPointer
>

This broke my build :-). Your solution didn't compile for TAO I fixed the TAO v
OMNIORB thing in a different way, extending AnyConversion with updateAny().
This avoids the new Any() creation alltogether. Tested for OMNIORB too.

Next, the ReadOnlyPointer unit test complains about:

./core-test
Running 11 test cases...
/home/kaltan/src/git/orocos-rtt/tests/ptr_test.cpp(82): error in
"testPromotion": check !ptr1.valid() failed
/home/kaltan/src/git/orocos-rtt/tests/ptr_test.cpp(100): error in
"testPromotion": check !ptr1.valid() failed

*** 2 failures detected in test suite "Master Test Suite"

Your fix ?

Peter

implementation question in corba transport

Peter Soetens wrote:
> On Thursday 22 April 2010 11:32:57 Sylvain Joyeux wrote:
>
>> Peter Soetens wrote:
>>
>>> On Wednesday 21 April 2010 11:01:54 Sylvain Joyeux wrote:
>>>
>>>> I'm making sure that the beta2 builds on OmniORB.
>>>>
>>>> To do that, I need to change the following pattern (which appears quite
>>>> a few times)
>>>>
>>>> const TypeInfo* ti = <get typeinfo>
>>>> CorbaTypeTransporter* ctt = <get transport>
>>>> CORBA::Any_var any = <create any>
>>>> args[i] = *any;
>>>>
>>>> where args is a sequence of anys.
>>>>
>>>> It is once mentioned that this line is supposed to make a copy.
>>>> Unfortunately the * operator to Any_var seems to be nonstandard. I
>>>> therefore need to know if the copying is really needed. IMO it does not,
>>>> as the Any_var will go out of scope (and the Any destroyed) anyway, so
>>>> it seems fine to just copy the Any_var with
>>>>
>>>> args[i] = any;
>>>>
>>> Any available patches I can pull yet ? I just pushed my latest status of
>>> rtt-2.0-mainline to github in case you want to rebase.
>>>
>> Yes, sorry. I was keeping them under my shoulder as I have other stuff
>> from my rubim fork to merge as well.
>>
>> I pushed the harmless patches I have until now to my github's for-peter
>> branch. There is omniorb fixes + a few modifications to ReadOnlyPointer
>>
>>
>
> This broke my build :-). Your solution didn't compile for TAO I fixed the TAO v
> OMNIORB thing in a different way, extending AnyConversion with updateAny().
> This avoids the new Any() creation alltogether. Tested for OMNIORB too.
>
> Next, the ReadOnlyPointer unit test complains about:
>
> ./core-test
> Running 11 test cases...
> /home/kaltan/src/git/orocos-rtt/tests/ptr_test.cpp(82): error in
> "testPromotion": check !ptr1.valid() failed
> /home/kaltan/src/git/orocos-rtt/tests/ptr_test.cpp(100): error in
> "testPromotion": check !ptr1.valid() failed
>
> *** 2 failures detected in test suite "Master Test Suite"
>
> Your fix ?
>
Weird... I actually ran the test suite and had no problem there.

The behaviour of write_access() changed to *not* reset the pointer. So,
valid() should now remain true ...

Sylvain
> Peter
>

implementation question in corba transport

On Wednesday 21 April 2010 11:01:54 Sylvain Joyeux wrote:
> I'm making sure that the beta2 builds on OmniORB.
>
> To do that, I need to change the following pattern (which appears quite
> a few times)
>
> const TypeInfo* ti = <get typeinfo>
> CorbaTypeTransporter* ctt = <get transport>
> CORBA::Any_var any = <create any>
> args[i] = *any;
>
> where args is a sequence of anys.
>
> It is once mentioned that this line is supposed to make a copy.
> Unfortunately the * operator to Any_var seems to be nonstandard. I
> therefore need to know if the copying is really needed. IMO it does not,
> as the Any_var will go out of scope (and the Any destroyed) anyway, so
> it seems fine to just copy the Any_var with
>
> args[i] = any;
>
> Am I missing something ?

No you aren't. The copy is not necessary, so your solution is better.

Peter