Commit 8128106

I’m trying to understand what this commit is for. The commit message only says what it does, but doesn’t say what the original problem was, nor why this was the correct fix.

Can anyone illuminate?

Cheers
S

Commit: 81281067c891b28929e9e8a0520ec04f54247216 [8128106]
Parents: 1fe39e56e1
Author: Johannes Meyer <johannes [..] ...>
Date: July 15, 2014 at 13:35:19 EDT
Commit Date: July 15, 2014 at 13:44:16 EDT

Do not reset the caller engine in OperationCaller assignment

Use case:
RTT::OperationCaller<bool()> op("bar", this->engine());
op = this->getPeer("foo")->getOperation("bar");
assert(op.mcaller);

Signed-off-by: Johannes Meyer <johannes [..] ...>

Commit 8128106

Hello Stephen,

there are some more details in the original pull request at GitHub:
https://github.com/orocos-toolchain/rtt/pull/48

Basically an OperationCaller instance has a name, a pointer to the
caller ExecutionEngine (usually the engine of the component that owns
the OperationCaller) and a pointer to its implementation. The
implementation part can be empty if the OperationCaller is not yet
ready. The caller engine is needed to wake up the caller's thread if the
operation executing in another thread is finished (please correct me if
I am wrong, Peter). Otherwise the operation call might block in certain
cases.

There are many ways to initialize an OperationCaller. One possibility is
to add it to a ServiceRequester
(this->requires()->addOperationCaller(opcaller)) and use its connectTo()
method to connect it to a Service providing a matching Operation. In
this case connectTo() sets the OperationCaller's caller engine. Another
possibility is shown in the piece of code in the commit message and the
pull request. An OperationCaller that was already initialized with a
caller engine in its constructor should not "forget" it if the
assignment operator is used to connect it to an Operation or any other
possible implementation variant. Without this patch this was the case as
a new temporary OperationCaller instance without the caller information
is created and assigned.

Of course there are also other possibilities to solve this issue, e.g.
not to overwrite the caller pointer if the right-hand side of the
assignment is another OperationCaller.

Best regards,
Johannes

Am 26.08.2014 19:46, schrieb S Roderick:
> I’m trying to understand what this commit is for. The commit message
> only says what it does, but doesn’t say what the original problem was,
> nor why this was the correct fix.
>
> Can anyone illuminate?
>
> Cheers
> S
>
> *Commit:*81281067c891b28929e9e8a0520ec04f54247216[8128106]
> *Parents:*1fe39e56e1 <rev://1fe39e56e1585ad89a7419fde46332c648e1517f>
> *Author:*Johannes Meyer <johannes [..] ...
> <mailto:johannes [..] ...>>
> *Date:*July 15, 2014 at 13:35:19 EDT
> *Commit Date:*July 15, 2014 at 13:44:16 EDT
>
> Do not reset the caller engine in OperationCaller assignment
>
> Use case:
> RTT::OperationCaller<bool()> op("bar", this->engine());
> op = this->getPeer("foo")->getOperation("bar");
> assert(op.mcaller);
>
> Signed-off-by: Johannes Meyer <johannes [..] ...
> <mailto:johannes [..] ...>>
>
>