47 #ifndef _MIRA_CYCLICRUNNABLE_H_ 48 #define _MIRA_CYCLICRUNNABLE_H_ 51 #include <boost/function.hpp> 98 mName =
"CyclicRunnable " +
toString(
this);
109 const std::string& name=
"") :
124 boost::timed_mutex theMutex;
125 boost::system_time endtime = boost::get_system_time();
126 while ( !boost::this_thread::interruption_requested() )
133 boost::timed_mutex::scoped_lock lock(theMutex);
137 theMutex.timed_lock(endtime);
149 boost::function<void ()> mFunction;
static Type & instance()
Returns a reference to the singleton instance.
Definition: Singleton.h:544
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
A thread monitor, which collects information about the resources of all running threads of the curren...
CyclicRunnable(boost::function< void()> fn, const std::string &name="")
Constructs a CyclicRunnable with given functor.
Definition: CyclicRunnable.h:92
Time and Duration wrapper class.
Contains toString and fromString functions for converting data types to strings and the other way rou...
static bool isDestroyed()
Returns true, if the singleton was already destroyed.
Definition: Singleton.h:552
std::string toString(const T &value, int precision=-1)
Converts any data type to string (the data type must support the stream << operator).
Definition: ToString.h:256
CyclicRunnable(boost::function< void()> fn, const Duration &interval, const std::string &name="")
Constructs a CyclicRunnable with given functor and interval.
Definition: CyclicRunnable.h:108
This class extends threads by the ability to execute an operation repeatedly in an defined interval...
Definition: CyclicRunnable.h:82
Use this class to represent time durations.
Definition: Time.h:106
void operator()()
Bind this to a thread to execute the given functor in the specified interval.
Definition: CyclicRunnable.h:119
Duration cycleTime
The cycle time, this cyclic runnable calls its assigned function.
Definition: CyclicRunnable.h:146