terminate called after throwing an instance of 'RTT::wrong_number_of_args_exception'

Hi everyone!

i get the following error when i try to react on a event (form another Task) and trying to setup the Handler like this:

h =this->getPeer("EventTask")->events()->setupConnection("theEvent").callback(this,&Klc::react).handle();
assert( h.ready() );
h.connect();

results in:

terminate called after throwing an instance of 'RTT::wrong_number_of_args_exception'
what(): Wrong number of arguments: Expected 1, received 0.

Here the code form the EventTask:
Event E_theEvent;
...
EventTask::EventTask(string nam) :TaskContext(n)
, E_theEvent("theEvent") {
...
this->events()->addEvent( &E_theEvent, "bla", "blub","blub" );
...}

and i emit the event like this (EventTask):
Event< void(bool) > move_event = this->events()->getEvent( "theEvent");
assert( move_event.ready() );
move_event(1);

I hope i got the relevant code - so does anybody have a idea?

regards
ct

terminate called after throwing an instance of 'RTT::wrong_numbe

On Friday 28 November 2008 13:14:19 cturnercomplex [..] ... wrote:
> Hi everyone!
>
>
> i get the following error when i try to react on a event (form another
> Task) and trying to setup the Handler like this:
>
> h
> =this->getPeer("EventTask")->events()->setupConnection("theEvent").callback
>(this,&Klc::react).handle(); assert( h.ready() );
> h.connect();

This looks ok...

>
> results in:
>
> terminate called after throwing an instance of
> 'RTT::wrong_number_of_args_exception' what(): Wrong number of arguments:
> Expected 1, received 0.

Could it be that Klc::react does not take an argument ? What is the function
signature of the react function ?

>
> Here the code form the EventTask:
> Event E_theEvent;

You probably meant: Event E_theEvent;

> ...
> EventTask::EventTask(string nam) :TaskContext(n)
> , E_theEvent("theEvent") {
> ...
> this->events()->addEvent( &E_theEvent, "bla", "blub","blub" );
> ...}

ok.

>
> and i emit the event like this (EventTask):
> Event< void(bool) > move_event = this->events()->getEvent( "theEvent");
> assert( move_event.ready() );
> move_event(1);

ok.

>
>
> I hope i got the relevant code - so does anybody have a idea?

It should work, given that react has the correct signature.

Peter