6 #ifndef YARP_OS_TIMER_H
7 #define YARP_OS_TIMER_H
11 #ifndef YARP_NO_DEPRECATED
12 #define YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
14 #undef YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
73 TimerSettings(
double inPeriod,
size_t count,
double seconds,
double inTollerance) :
77 tolerance(inTollerance)
110 #ifndef YARP_NO_DEPRECATED
150 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
165 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
184 const TimerCallback& callback,
186 std::mutex* mutex =
nullptr);
204 std::mutex* mutex =
nullptr) :
206 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
218 std::mutex* mutex =
nullptr) :
220 Timer(settings, std::bind(callback, object, std::placeholders::_1), newThread, mutex)
238 virtual bool start();
244 virtual bool isRunning();
246 #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.