The Component Builder's Manual has this text:
There are two ways to add a port to the TaskContext interface: using addPort() or addEventPort(). In the latter case, new data arriving on the port will wake up ('trigger') the activity of our TaskContext and updateHook() get's executed. If you want to know which port caused the wake-up, do not implement updateHook() (ie remove this function from your component) and use updateHook(const std::vector<PortInterface*>& updatedPorts) which provides you a list of all ports having received new data. If your task woke up for another reason, updatedPorts will be empty.
I think that updateHook(const std::vector<PortInterface*>& updatedPorts) no longer works, right?
Theo.
error in documentation about addEventPort?
2011/4/12 t [dot] j [dot] a [dot] devries [..] ... <t [dot] j [dot] a [dot] devries [..] ...>
> The Component Builder's Manual has this text:
>
> There are two ways to add a port to the TaskContext interface: using
> addPort() or addEventPort(). In the latter case, new data arriving on the
> port will wake up ('trigger') the activity of our TaskContext and
> updateHook() get's executed. If you want to know which port caused the
> wake-up, do not implement updateHook() (ie remove this function from your
> component) and use updateHook(const std::vector<PortInterface*>&
> updatedPorts) which provides you a list of all ports having received new
> data. If your task woke up for another reason, updatedPorts will be empty.
>
> I think that
> updateHook(const std::vector<PortInterface*>& updatedPorts)
> no longer works, right?
>
AFAIK, it still works.
If you have multiple event ports and want to avoid checking which one woke
up your component, you can bind them all to seperate methods, e.g.
this->addEventPort("PortName", Port, boost::bind(&MyCustomMethod,this,_1));
where MyCustomMethod has signature:
MyCustomMethod(RTT::base::PortInterface* portInterface)
Regards,
Steven
>
> Theo.
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>