9 #ifndef YARP_OS_TIMER_H
10 #define YARP_OS_TIMER_H
14 #ifndef YARP_NO_DEPRECATED
15 #define YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
17 #undef YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
76 TimerSettings(
double inPeriod,
size_t count,
double seconds,
double inTollerance) :
80 tolerance(inTollerance)
113 #ifndef YARP_NO_DEPRECATED
153 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
168 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
187 const TimerCallback& callback,
189 std::mutex* mutex =
nullptr);
207 std::mutex* mutex =
nullptr) :
209 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
221 std::mutex* mutex =
nullptr) :
223 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
241 virtual bool start();
247 virtual bool isRunning();
249 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Basic wrapper for mutual exclusion.
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, std::mutex *mutex=nullptr)
Timer constructor.
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, yarp::os::Mutex *mutex)
Timer constructor.
Timer(const Timer &)=delete
std::function< bool(const yarp::os::YarpTimerEvent &)> TimerCallback
Timer operator=(const Timer &)=delete
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &) const, const T *object, bool newThread, yarp::os::Mutex *mutex)
const version.
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &) const, const T *object, bool newThread, std::mutex *mutex=nullptr)
const version.
The main, catch-all namespace for YARP.
TimerSettings(double inPeriod, size_t count, double seconds, double inTollerance)
bool operator==(const TimerSettings &rhs) const
TimerSettings(double inPeriod, size_t count, double seconds)
TimerSettings(double inPeriod)
double lastReal
lastReal when the last callback actually happened
double lastExpected
lastExpected when the last callback actually happened
double currentReal
currentReal When the current callback is actually being called
double lastDuration
lastDuration Contains the duration of the last callback
unsigned int runCount
runCount the count of calls
double currentExpected
currentExpected this is when the current callback should have been called
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.