DUECA/DUSIME
|
Base class for all objects that can set activities into motion. More...
#include <Trigger.hxx>
Classes | |
struct | TargetData |
Combination of data needed to work with a target. More... | |
Public Member Functions | |
const std::string & | getTriggerName () const |
Find a name. | |
Protected Types | |
typedef list< TargetData > | targetlist_type |
Combination of a target, someone to pull if requested, and the index that target needs to identify this puller. | |
Protected Member Functions | |
void | pull (const DataTimeSpec &ts) |
activate and notify the targets | |
TriggerPuller (const std::string &name=std::string()) | |
Constructor. | |
virtual | ~TriggerPuller () |
Destructor. | |
virtual void | addTarget (const boost::intrusive_ptr< TriggerTarget > &target, unsigned id) |
Add a target to this puller, only called by TriggerTarget's setTrigger. | |
virtual void | removeTarget (const TriggerTarget *target) |
Remove a target from the puller, only called by destructor. | |
virtual void | setTriggerName () |
Update the name, used by ConditionAnd and ConditionOr. | |
Protected Attributes | |
targetlist_type | targets |
List of targets and indices. | |
std::bitset< MAX_MANAGERS > | activitylevels |
Index of activitymanager levels. | |
std::string | name |
Name, for debugging purposes. | |
Friends | |
class | TriggerTarget |
class | ConditionAnd |
class | ConditionOr |
class | UChannelEntry |
class | TargetAndPuller |
Base class for all objects that can set activities into motion.
Several objects in DUECA are derived from this class, e.g. channel read tokens, and various alarm types (PeriodicAlarm, AperiodicAlarm).
Using derivatives of the TriggerPuller class, and derivatives of its companion, the TriggerTarget, application programmers can flexibly specify triggering conditions. The triggering commonly ends up at the ActivityCallback class. When triggering conditions produce a valid activation, the ActivityCallback class is scheduled with its associated ActivityManager, and the callback subsequently executed.
This class is not normally used directly for application programming. The typical approach is to take TriggerTargets (normally the ActivityCallback), and use alarms or channel read tokens as triggers for these targets with the setTrigger() call.
Optionally, more complex triggering conditions can be obtained by using a ConditionAnd or ConditionOr object to combine triggering activations.
|
protectedvirtual |
Add a target to this puller, only called by TriggerTarget's setTrigger.
Reimplemented in dueca::ChannelReadToken.