MADARA  3.2.3
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 
20  namespace knowledge
21  {
22 
27  struct MADARA_EXPORT EvalSettings : public KnowledgeUpdateSettings
28  {
29  /* Convenient pre-defined settings objects */
30 
32  static const EvalSettings DEFAULT;
33 
35  static const EvalSettings NO_EXPAND;
36 
38  static const EvalSettings DELAY;
39 
42 
47  : KnowledgeUpdateSettings (), delay_sending_modifieds (false),
48  pre_print_statement (""), post_print_statement ("")
49  {
50  }
51 
52 
78  explicit EvalSettings (bool t_delay_sending_modifieds,
79  bool t_treat_globals_as_locals = false,
80  bool t_signal_updates = true,
81  bool t_always_overwrite = false,
82  bool t_always_expand = true,
83  bool t_track_local_changes = false,
84  std::string t_pre_print_statement = "",
85  std::string t_post_print_statement = "",
86  uint64_t t_clock_increment = 1,
87  bool t_treat_locals_as_globals = false)
88  : KnowledgeUpdateSettings (t_treat_globals_as_locals,
89  t_signal_updates, t_always_overwrite,
90  t_always_expand, t_track_local_changes,
91  t_clock_increment, t_treat_locals_as_globals),
92  delay_sending_modifieds (t_delay_sending_modifieds),
93  pre_print_statement (t_pre_print_statement),
94  post_print_statement (t_post_print_statement)
95  {
96  }
97 
103  : KnowledgeUpdateSettings (rhs),
104  delay_sending_modifieds (rhs.delay_sending_modifieds),
105  pre_print_statement (rhs.pre_print_statement),
106  post_print_statement (rhs.post_print_statement),
107  send_list (rhs.send_list)
108  {
109  }
110 
116 
121 
126 
131  std::map <std::string, bool> send_list;
132  };
133  }
134 }
135 #endif //_MADARA_EVAL_SETTINGS_
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)
Constructor.
Definition: EvalSettings.h:78
std::map< std::string, bool > send_list
Map of record names that are allowed to be sent after operation.
Definition: EvalSettings.h:131
std::string pre_print_statement
Statement to print before evaluations.
Definition: EvalSettings.h:120
static const EvalSettings DELAY
Settings to delay sending modifieds, but do expand variables.
Definition: EvalSettings.h:38
std::string post_print_statement
Statement to print after evaluations.
Definition: EvalSettings.h:125
static struct madara::knowledge::tags::string_t string
Encapsulates settings for an evaluation statement.
Definition: EvalSettings.h:27
Provides functions and classes for the distributed knowledge base.
Settings for applying knowledge updates.
static const EvalSettings DELAY_NO_EXPAND
Settings to delay sending modifieds, and not expand variables.
Definition: EvalSettings.h:41
static const EvalSettings NO_EXPAND
Settings to immediately send modifieds, and not expand variables.
Definition: EvalSettings.h:35
Copyright (c) 2015 Carnegie Mellon University.
static const EvalSettings DEFAULT
Settings to immediately send modifieds, but do expand variables.
Definition: EvalSettings.h:32
bool delay_sending_modifieds
Toggle for sending modifieds in a single update event after each evaluation.
Definition: EvalSettings.h:115
EvalSettings(const EvalSettings &rhs)
Copy constructor.
Definition: EvalSettings.h:102