|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_OS_TIMER_H
10 #define YARP_OS_TIMER_H
14 #ifndef YARP_NO_DEPRECATED // since YARP 3.3
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 // Since YARP 3.3
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
254 #endif // DOXYGEN_SHOULD_SKIP_THIS
260 #endif // YARP_OS_TIMER_H
TimerSettings(double inPeriod, size_t count, double seconds)
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
TimerSettings(double inPeriod)
double lastExpected
lastExpected when the last callback actually happened
Timer operator=(const Timer &)=delete
Timer(const Timer &)=delete
TimerSettings(double inPeriod, size_t count, double seconds, double inTollerance)
unsigned int runCount
runCount the count of calls
double lastReal
lastReal when the last callback actually happened
std::function< bool(const yarp::os::YarpTimerEvent &)> TimerCallback
double currentReal
currentReal When the current callback is actually being called
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.
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, std::mutex *mutex=nullptr)
Timer constructor.
double currentExpected
currentExpected this is when the current callback should have been called
bool operator==(const TimerSettings &rhs) const
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.
The main, catch-all namespace for YARP.
double lastDuration
lastDuration Contains the duration of the last callback
Basic wrapper for mutual exclusion.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
Timer(const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, yarp::os::Mutex *mutex)
Timer constructor.