|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Base of timers: after start(), expired() is run in the Task returned by task() every duration() milliseconds (or once if repetitive() is 0) until cancel(). More...
#include <Timer.hh>
Inherits Pds::Routine.
Public Member Functions | |
| Timer () | |
| Create the service routine for this timer. | |
| virtual | ~Timer () |
| Does nothing; empty virtual destructor. | |
| unsigned | start () |
| Arm the timer (TimerServiceRoutine::armTimer()); returns 0, or 1 if it was already running. | |
| unsigned | cancel () |
| Disarm the timer and, if it was running, make sure no expired() call is pending: remove it from the queue when called from the user task, else wait until the user task has drained its queue. | |
| virtual void | expired ()=0 |
| Pure virtual: the user code run in task() when the timer expires. | |
| virtual Task * | task ()=0 |
| Pure virtual: the Task in which expired() runs. | |
| virtual unsigned | duration () const =0 |
| Pure virtual: the timer period in milliseconds (per the comment). | |
| virtual unsigned | repetitive () const =0 |
| Pure virtual: 0 for a one-shot timer, non-zero for a repeating one (per the comment). | |
Public Member Functions inherited from Pds::Routine | |
| virtual | ~Routine () |
| Does nothing; empty virtual destructor. | |
Public Member Functions inherited from Pds::Entry | |
| Entry () | |
| Construct an entry whose links point to itself. | |
| Entry * | insert (Entry *after) |
| Insert this entry after after and return after. | |
| Entry * | insertList (Entry *after) |
| Splice the list that this entry belongs to (from this entry to its predecessor) in after after; returns after. | |
| Entry * | remove () |
| Unlink this entry from its list, relink it to itself and return it. | |
| Entry * | next () const |
| Return the next entry. | |
| Entry * | previous () const |
| Return the previous entry. | |
Base of timers: after start(), expired() is run in the Task returned by task() every duration() milliseconds (or once if repetitive() is 0) until cancel().
The header comment requires cancel() before destruction.
| Pds::Timer::Timer | ( | ) |
Create the service routine for this timer.
|
virtual |
Does nothing; empty virtual destructor.
| unsigned Pds::Timer::cancel | ( | ) |
Disarm the timer and, if it was running, make sure no expired() call is pending: remove it from the queue when called from the user task, else wait until the user task has drained its queue.
Returns 0, or 1 if the timer was not running.
|
pure virtual |
Pure virtual: the timer period in milliseconds (per the comment).
|
pure virtual |
Pure virtual: the user code run in task() when the timer expires.
|
pure virtual |
Pure virtual: 0 for a one-shot timer, non-zero for a repeating one (per the comment).
| unsigned Pds::Timer::start | ( | ) |
Arm the timer (TimerServiceRoutine::armTimer()); returns 0, or 1 if it was already running.