MADARA  3.4.1
Threader.inl
Go to the documentation of this file.
1 
2 
3 #ifndef _MADARA_THREADS_THREADER_INL_
4 #define _MADARA_THREADS_THREADER_INL_
5 
13 #include "Threader.h"
14 
16  const std::string& name, double hertz)
17 {
18  control_.set(name + ".hertz", hertz);
19 }
20 
22 {
23  control_.set(name + ".debug", true);
24 }
25 
27 {
28  control_.set(name + ".debug", false);
29 }
30 
32 {
33  debug_ = true;
34  control_.set(".debug_to_kb", prefix);
35 }
36 
38 {
39  debug_ = true;
40 }
41 
43 {
44  debug_ = false;
45 }
46 
49 {
50  return data_;
51 }
52 
55 {
56  return control_;
57 }
58 
59 #endif // _MADARA_THREADS_THREADER_INL_
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
int set(const VariableReference &variable, const std::string &value, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to a string.
void disable_debug(void)
Requests that all new threads disable debug mode.
Definition: Threader.inl:42
knowledge::KnowledgeBase get_data_plane(void)
Gets the data plane used by threads.
Definition: Threader.inl:48
knowledge::KnowledgeBase control_
The control plane used by threads for termination and pause information.
Definition: Threader.h:286
void enable_debug(void)
Requests that all new threads to enter debug mode.
Definition: Threader.inl:37
void change_hertz(const std::string &name, double hertz)
Modify hertz rate of a thread.
Definition: Threader.inl:15
void debug_to_kb(const std::string &prefix=".threader")
Requests all debugging for threads go into the data plane KB instead of the control plane.
Definition: Threader.inl:31
knowledge::KnowledgeBase get_control_plane(void)
Gets the control plane used by threads.
Definition: Threader.inl:54
constexpr string_t string