MADARA  3.4.1
EvalSettings.h
Go to the documentation of this file.
1 #ifndef _MADARA_EVAL_SETTINGS_
2 #define _MADARA_EVAL_SETTINGS_
3 
12 #include <string>
13 #include <map>
15 #include "madara/MadaraExport.h"
16 
17 namespace madara
18 {
19 namespace knowledge
20 {
25 struct MADARA_EXPORT EvalSettings : public KnowledgeUpdateSettings
26 {
27  /* Convenient pre-defined settings objects */
28 
30  static const EvalSettings DEFAULT;
31 
33  static const EvalSettings CHECKPOINT;
34 
36  static const EvalSettings DELAY;
37 
40 
42  static const EvalSettings EXPAND;
43 
45  static const EvalSettings DELAY_EXPAND;
46 
49 
51  static const EvalSettings NO_EXPAND;
52 
55 
57  static const EvalSettings SEND;
58 
60  static const EvalSettings SEND_EXPAND;
61 
64 
70  delay_sending_modifieds(false),
71  pre_print_statement(""),
72  post_print_statement("")
73  {
74  }
75 
104  explicit EvalSettings(bool t_delay_sending_modifieds,
105  bool t_treat_globals_as_locals = false, bool t_signal_updates = true,
106  bool t_always_overwrite = false, bool t_always_expand = true,
107  bool t_track_local_changes = false,
108  std::string t_pre_print_statement = "",
109  std::string t_post_print_statement = "", uint64_t t_clock_increment = 1,
110  bool t_treat_locals_as_globals = false,
111  bool t_stream_changes = true,
112  bool t_exceptions_on_unitialized = false)
113  : KnowledgeUpdateSettings(t_treat_globals_as_locals, t_signal_updates,
114  t_always_overwrite, t_always_expand, t_track_local_changes,
115  t_clock_increment, t_treat_locals_as_globals,
116  t_stream_changes,
117  t_exceptions_on_unitialized),
118  delay_sending_modifieds(t_delay_sending_modifieds),
119  pre_print_statement(t_pre_print_statement),
120  post_print_statement(t_post_print_statement)
121  {
122  }
123 
130  delay_sending_modifieds(rhs.delay_sending_modifieds),
131  pre_print_statement(rhs.pre_print_statement),
132  post_print_statement(rhs.post_print_statement),
133  send_list(rhs.send_list)
134  {
135  }
136 
142 
147 
152 
157  std::map<std::string, bool> send_list;
158 };
159 }
160 }
161 #endif //_MADARA_EVAL_SETTINGS_
Settings for applying knowledge updates.
constexpr string_t string
Provides functions and classes for the distributed knowledge base.
Copyright(c) 2020 Galois.
Encapsulates settings for an evaluation statement.
Definition: EvalSettings.h:26
static const EvalSettings SEND_EXPAND
Settings to immediately send modifieds and expand variables.
Definition: EvalSettings.h:60
std::map< std::string, bool > send_list
Map of record names that are allowed to be sent after operation.
Definition: EvalSettings.h:157
static const EvalSettings DELAY_CHECKPOINT
Settings to delay sending modifieds and enable checkpoints.
Definition: EvalSettings.h:39
static const EvalSettings DELAY_EXPAND
Settings to delay sending modifieds and expand variables.
Definition: EvalSettings.h:45
static const EvalSettings CHECKPOINT
Settings to enable checkpoints.
Definition: EvalSettings.h:33
EvalSettings(bool t_delay_sending_modifieds, bool t_treat_globals_as_locals=false, bool t_signal_updates=true, bool t_always_overwrite=false, bool t_always_expand=true, bool t_track_local_changes=false, std::string t_pre_print_statement="", std::string t_post_print_statement="", uint64_t t_clock_increment=1, bool t_treat_locals_as_globals=false, bool t_stream_changes=true, bool t_exceptions_on_unitialized=false)
Constructor.
Definition: EvalSettings.h:104
std::string post_print_statement
Statement to print after evaluations.
Definition: EvalSettings.h:151
static const EvalSettings NO_EXPAND_CHECKPOINT
Settings to not expand odifieds and enable checkpoints.
Definition: EvalSettings.h:54
static const EvalSettings DEFAULT
Settings to use whatever defaults there are.
Definition: EvalSettings.h:30
bool delay_sending_modifieds
Toggle for sending modifieds in a single update event after each evaluation.
Definition: EvalSettings.h:141
static const EvalSettings SEND_NO_EXPAND
Settings to immediately send modifieds and not expand variables.
Definition: EvalSettings.h:63
static const EvalSettings SEND
Settings to immediately send modifieds and expand variables.
Definition: EvalSettings.h:57
static const EvalSettings DELAY
Settings to delay sending modifieds and expand variables.
Definition: EvalSettings.h:36
static const EvalSettings NO_EXPAND
Settings to delay sending modifieds and expand variables.
Definition: EvalSettings.h:51
static const EvalSettings EXPAND
Settings to delay sending modifieds and expand variables.
Definition: EvalSettings.h:42
EvalSettings(const EvalSettings &rhs)
Copy constructor.
Definition: EvalSettings.h:128
static const EvalSettings DELAY_NO_EXPAND
Settings to delay send modifieds and not expand variables.
Definition: EvalSettings.h:48
std::string pre_print_statement
Statement to print before evaluations.
Definition: EvalSettings.h:146