22#include <pv/timeStamp.h>
29namespace epics {
namespace pvData {
33typedef std::tr1::shared_ptr<TimerCallback> TimerCallbackPtr;
34typedef std::tr1::shared_ptr<Timer> TimerPtr;
66 struct IncreasingTime;
73class epicsShareClass
Timer :
private Runnable {
75 POINTER_DEFINITIONS(
Timer);
80 Timer(std::string threadName, ThreadPriority priority);
90 TimerCallbackPtr
const &timerCallback,
99 TimerCallbackPtr
const &timerCallback,
107 bool cancel(TimerCallbackPtr
const &timerCallback);
118 void dump(std::ostream& o)
const;
124 void addElement(TimerCallbackPtr
const &timerCallback);
136epicsShareExtern std::ostream&
operator<<(std::ostream& o,
const Timer& timer);
basic_ostream< _CharT, _Traits > & operator<<(basic_ostream< _CharT, _Traits > &__os, const basic_string< _CharT, _Traits, _Alloc > &__str)
C++ wrapper for epicsEvent from EPICS base.
C++ wrapper for epicsThread from EPICS base.
Class that must be implemented by code that makes Timer requests.
virtual void callback()=0
virtual void timerStopped()=0
Support for delayed or periodic callback execution.
void dump(std::ostream &o) const
void close()
Prevent new callbacks from being scheduled, and cancel pending callbacks.
bool cancel(TimerCallbackPtr const &timerCallback)
void schedulePeriodic(TimerCallbackPtr const &timerCallback, double delay, double period)
Timer(std::string threadName, ThreadPriority priority)
bool isScheduled(TimerCallbackPtr const &timerCallback) const
void scheduleAfterDelay(TimerCallbackPtr const &timerCallback, double delay)