Go to the documentation of this file.
25 #include <Ice/PropertiesF.h>
27 #include "../application/Application.h"
31 #include "ArmarXCore/interface/core/UserException.h"
74 throw NotImplementedYetException(
"scheduleReleated: function not yet implemented.");
90 if (it->task.get() == task.get())
112 std::vector<IceUtil::TimerTaskPtr> tasksToRun;
120 tasksToRun.emplace_back(it->task);
130 for (std::vector<IceUtil::TimerTaskPtr>::iterator it = tasksToRun.begin(); it != tasksToRun.end(); ++it)
132 (*it)->runTimerTask();
179 if (IceUtil::ThreadControl().
id() == getThreadControl().
id())
181 getThreadControl().detach();
185 getThreadControl().join();
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::TimerPtr iceTimer
timer for use in system time mode
static LocalTimeServerPtr GetTimeServer()
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.
static ApplicationPtr getInstance()
Retrieve shared pointer to the application object.
armarx::core::time::DateTime Time
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
void call() override
wakes up the execution thread to check if a task has to run
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.