Go to the documentation of this file.
27 #include <IceUtil/Handle.h>
28 #include <IceUtil/Shared.h>
29 #include <IceUtil/Thread.h>
30 #include <IceUtil/Time.h>
31 #include <IceUtil/Timer.h>
33 #include <condition_variable>
43 IceUtil::TimerTaskPtr
task;
59 public virtual IceUtil::Shared,
60 private virtual IceUtil::Thread,
68 Timer(
bool forceSystemTime =
false);
100 bool cancel(
const IceUtil::TimerTaskPtr& task);
105 void call()
override;
void destroy()
destroys the Timer and detaches the exection thread if the calling thread is the timer thread,...
std::mutex scheduledTasksMutex
used for locking scheduledTasks
IceUtil::TimerTaskPtr task
IceUtil::TimerPtr iceTimer
timer for use in system time mode
bool running
set to false to stop the execution thread
void run() override
the execution thread main method
void schedule(const IceUtil::TimerTaskPtr &task, const IceUtil::Time &interval)
schedules a task for execution
std::mutex callbackWaitMutex
used for waiting for a callback from the LocalTimeServer
Interval< T > interval(T lo, T hi)
Used by CallbackWaitLock.
armarx::core::time::DateTime Time
void call() override
wakes up the execution thread to check if a task has to run
Timer implementation with TimeServer support.
std::vector< ScheduledTask > scheduledTasks
list of scheduled tasks
std::condition_variable condWait
used for waiting for a callback from the LocalTimeServer
void scheduleRepeated(const IceUtil::TimerTaskPtr &task, const IceUtil::Time &interval)
schedules a task for repeated execution
bool called
if call() has been called.
bool getUseSystemTime() const
bool useSystemTime
if we are using the system time (or the TimeServer time)
bool cancel(const IceUtil::TimerTaskPtr &task)
cancels a task, returns true if the task was successfully canceled (i.e.
This file offers overloads of toIce() and fromIce() functions for STL container types.
Timer(bool forceSystemTime=false)
constructs a new Timer and starts its execution thread.