CTimedTrigger

Name

CTimedTrigger -- CEventTrigger that fires periodically

Synopsis


#include <CTimedTrigger.h>
         
 class CTimedTrigger : public CEventTrigger {

  CTimedTrigger(const timespec& interval);
  CTimedTrigger(const CTimedTrigger& interval);

  void setPeriod(const struct timespec& newInterval);
  virtual void setup();
  virtual bool operator()();
}

Description

Provides a concrete CEventTrigger class that fires periodically. Note that the trigger is not latched, that that is once operator() returns true it won't do so again until the trigger is next due to fire.

This is the typical event trigger attached to scaler readout.

Public member functions

CTimedTrigger(const timespec& interval);

Constructs a trigger that will fire periodically. The trigger interval is interval. This can be modified by calling setPeriod

CTimedTrigger(const CTimedTrigger& interval);

Copy construction.

void setPeriod(const struct timespec& newInterval);

Sets the new trigger period. This takes effect immediately. If the time since the last trigger is greater than newInterval the next call to operator() will return true.

virtual void setup();

Initializes the trigger by setting the last fired time to now.

virtual bool operator()();

Returns true if the last trigger was more longer ago than the trigger period.