when to connect an eventport?

Hi,

I'm having a problem with an eventport in my component. The function being called, shouldn't do anything until my component is configured.
What is the best way to do this? Should I just put the whole body of my function in an if-statement?
Should I connect the port after I have configured my component?

regards,

Pieterjan Bartels

when to connect an eventport?

Hi Pieterjan,

On Fri, Sep 14, 2012 at 11:15 AM, Pieterjan Bartels
<pj [dot] bartels [..] ...> wrote:
> Hi,
>
> I'm having a problem with an eventport in my component. The function being called, shouldn't do anything until my component is configured.
> What is the best way to do this? Should I just put the whole body of my function in an if-statement?
> Should I connect the port after I have configured my component?

Both solutions are the only valid options today. Preferably, you could just add:

if ( !this->isRunning() ) return;

to the top of your callback function.

The real question is if a non-running component should execute the
event port callbacks or not. I'm not tempted to change this behavior,
although similar discussions have happened in the past regarding the
execution semantics of the callbacks.

Peter