1 #ifndef _MADARA_THREADS_WORKER_THREAD_INL_ 2 #define _MADARA_THREADS_WORKER_THREAD_INL_ 20 bool & one_shot,
bool & blaster)
26 "WorkerThread(%s)::svc:" \
27 " thread repeating at %f hz\n",
name_.c_str (),
hertz_);
34 next_epoch += frequency;
41 "WorkerThread(%s)::svc:" \
42 " thread blasting at infinite hz\n",
name_.c_str ());
50 "WorkerThread(%s)::svc:" \
51 " thread running once\n",
name_.c_str ());
57 #endif // _MADARA_THREADS_WORKER_THREAD_H_
double hertz_
hertz rate for worker thread executions
Duration seconds_to_duration(double seconds)
Returns seconds in double format as nanosecond duration.
MADARA_EXPORT utility::Refcounter< logger::Logger > global_logger
std::chrono::time_point< Clock > TimeValue
time point
Provides a quality-of-service-enabled threading library.
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
std::string name_
the name of the contained thread
void change_frequency(double hertz, utility::TimeValue ¤t, utility::Duration &frequency, utility::TimeValue &next_epoch, bool &one_shot, bool &blaster)
Changes the frequency given a hertz rate.
Copyright (c) 2015 Carnegie Mellon University.
std::chrono::nanoseconds Duration
default clock duration