21# ifndef PASSIVETIMER_H_
22# define PASSIVETIMER_H_
25#include <condition_variable>
31#include <Poco/Timespan.h>
37 typedef Poco::Timespan::TimeDiff timeout_t;
49 virtual timeout_t
setTiming( timeout_t msec ) noexcept = 0;
50 virtual
void reset() noexcept = 0;
55 timeout_t
getLeft( timeout_t timeout ) const noexcept;
60 virtual
bool wait(timeout_t timeMS);
64 virtual void stop() noexcept;
69 static const timeout_t
WaitUpTime =
std::numeric_limits<timeout_t>::max();
72 static const Poco::Timespan millisecToPoco( const timeout_t msec ) noexcept;
73 static const Poco::Timespan microsecToPoco( const timeout_t usec ) noexcept;
100 virtual bool checkTime()
const noexcept override;
101 virtual timeout_t
setTiming( timeout_t msec )
noexcept override;
102 virtual void reset()
noexcept override;
104 virtual timeout_t
getCurrent()
const noexcept override;
109 virtual timeout_t
getInterval()
const noexcept override;
111 virtual void terminate()
noexcept override;
114 timeout_t t_msec = { 0 };
121 std::chrono::steady_clock::time_point
t_start;
145 virtual bool wait(timeout_t t_msec)
noexcept override;
146 virtual void terminate()
noexcept override;
151 std::atomic_bool terminated;
152 std::mutex m_working;
153 std::condition_variable cv_working;
Пассивный таймер с режимом засыпания (ожидания)
Definition PassiveTimer.h:139
Пассивный таймер
Definition PassiveTimer.h:94
std::chrono::milliseconds t_inner_msec
Definition PassiveTimer.h:122
std::chrono::steady_clock::time_point t_start
Definition PassiveTimer.h:121
Базовый интерфейс пассивных таймеров
Definition PassiveTimer.h:44
virtual timeout_t getCurrent() const noexcept=0
timeout_t getLeft(timeout_t timeout) const noexcept
Definition PassiveTimer.cc:95
virtual timeout_t getInterval() const noexcept=0
static const timeout_t MinQuantityTime
Definition PassiveTimer.h:78
virtual void reset() noexcept=0
virtual void stop() noexcept
Definition PassiveTimer.cc:110
virtual void terminate()
Definition PassiveTimer.h:61
virtual bool checkTime() const noexcept=0
virtual bool wait(timeout_t timeMS)
Definition PassiveTimer.cc:105
static const timeout_t WaitUpTime
Definition PassiveTimer.h:69
virtual timeout_t setTiming(timeout_t msec) noexcept=0
Definition Calibration.h:27