1 #ifndef _MADARA_THREADS_WORKER_THREAD_H_
2 #define _MADARA_THREADS_WORKER_THREAD_H_
112 bool& one_shot,
bool& blaster);
209 #include "WorkerThread.inl"
madara::knowledge::KnowledgeRecord::Integer Integer
This class provides a distributed knowledge base to users.
Abstract base class for implementing threads.
Starts threads with first class support of MADARA contexts.
A thread that executes BaseThread logic.
knowledge::containers::Double new_hertz_
thread safe hertz reference
knowledge::containers::Integer end_time_
timestamp of the last svc end
knowledge::containers::Integer max_duration_
maximum duration of all runs
void run(void)
Starts the thread, with entry point svc()
WorkerThread()
Default constructor.
knowledge::containers::Integer start_time_
timestamp of the initial svc start
knowledge::containers::Integer executions_
thread safe start flag that will be sent to the knowledge base on launch of the thread
WorkerThread(const std::string &name, BaseThread *thread, knowledge::KnowledgeBase *control, knowledge::KnowledgeBase *data, double hertz=-1.0)
Constructor deprecated: use version that takes control and data by value.
knowledge::containers::Integer finished_
thread safe finished flag that will be sent to the knowledge base on completion of the thread
knowledge::KnowledgeBase data_
the data plane (the knowledge base)
knowledge::KnowledgeBase control_
the control plane to the knowledge base
knowledge::containers::Integer debug_
flag for whether or not to save debug information in control
knowledge::containers::Integer started_
thread safe start flag that will be sent to the knowledge base on launch of the thread
knowledge::containers::Integer last_duration_
duration of last run
std::unique_ptr< BaseThread > thread_
the contained thread
std::thread me_
Assignment operator.
WorkerThread(WorkerThread &&other)=default
double hertz_
hertz rate for worker thread executions
madara::knowledge::containers::Integer paused_
thread safe paused flag that will be sent to the knowledge base to indicate thread activities should ...
~WorkerThread() noexcept
Destructor.
std::string name_
the name of the contained thread
madara::knowledge::containers::Integer running_
thread safe paused flag that will be sent to the knowledge base to indicate thread activities should ...
knowledge::containers::Integer min_duration_
minimum duration of all runs
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.
knowledge::containers::Integer last_start_time_
timestamp of the last svc start
Provides container classes for fast knowledge base access and mutation.
Provides functions and classes for the distributed knowledge base.
Provides a quality-of-service-enabled threading library.
std::map< std::string, std::unique_ptr< WorkerThread > > NamedWorkerThreads
Collection of named threads.
Provides utility functions and classes for common tasks and needs.
std::chrono::time_point< Clock > TimeValue
time point
std::chrono::nanoseconds Duration
default clock duration
Copyright(c) 2020 Galois.