27#include <Ice/PropertiesF.h>
32#include "ArmarXCore/interface/core/UserException.h"
78 throw NotImplementedYetException(
"scheduleReleated: function not yet implemented.");
93 for (std::vector<ScheduledTask>::iterator it =
scheduledTasks.begin();
96 if (it->task.get() == task.get())
119 std::vector<IceUtil::TimerTaskPtr> tasksToRun;
123 for (std::vector<ScheduledTask>::iterator it =
scheduledTasks.begin();
128 tasksToRun.emplace_back(it->task);
138 for (std::vector<IceUtil::TimerTaskPtr>::iterator it = tasksToRun.begin();
139 it != tasksToRun.end();
142 (*it)->runTimerTask();
192 if (IceUtil::ThreadControl().
id() == getThreadControl().
id())
194 getThreadControl().detach();
198 getThreadControl().join();
static ApplicationPtr getInstance()
Retrieve shared pointer to the application object.
Used by CallbackWaitLock.
static LocalTimeServerPtr GetTimeServer()
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
std::vector< ScheduledTask > scheduledTasks
list of scheduled tasks
bool useSystemTime
if we are using the system time (or the TimeServer time)
std::condition_variable condWait
used for waiting for a callback from the LocalTimeServer
std::mutex scheduledTasksMutex
used for locking scheduledTasks
bool running
set to false to stop the execution thread
void destroy()
destroys the Timer and detaches the exection thread if the calling thread is the timer thread,...
bool called
if call() has been called.
bool cancel(const IceUtil::TimerTaskPtr &task)
cancels a task, returns true if the task was successfully canceled (i.e.
bool getUseSystemTime() const
void call() override
wakes up the execution thread to check if a task has to run
void run() override
the execution thread main method
IceUtil::TimerPtr iceTimer
timer for use in system time mode
std::mutex callbackWaitMutex
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
void schedule(const IceUtil::TimerTaskPtr &task, const IceUtil::Time &interval)
schedules a task for execution
This file offers overloads of toIce() and fromIce() functions for STL container types.
Interval< T > interval(T lo, T hi)