HOPS
HOPS class reference
MHO_ControlConditionEvaluator.hh
Go to the documentation of this file.
1 #ifndef MHO_ControlConditionEvaluator_HH__
2 #define MHO_ControlConditionEvaluator_HH__
3 
5 #include "MHO_Message.hh"
7 
8 #include <list>
9 #include <stack>
10 #include <string>
11 #include <vector>
12 
13 namespace hops
14 {
15 
25 {
26 
27  public:
30 
39  void SetPassInformation(std::string baseline, std::string source, std::string fgroup, std::string scan_time);
40 
47  mho_json GetApplicableStatements(mho_json& control_contents);
48 
55  bool Evaluate(mho_json& control_condition);
56 
57  private:
58  using token_iter = std::vector< std::string >::iterator;
59 
67  int ProcessToken(token_iter& it, token_iter& it_end);
68 
75  int EvaluateStation(token_iter& it);
76 
83  int EvaluateBaseline(token_iter& it);
84 
91  int EvaluateTwoCharacterBaseline(token_iter& it);
92 
99  int EvaluateMultiCharacterBaseline(token_iter& it);
100 
107  int EvaluateSource(token_iter& it);
114  int EvaluateFrequencyGroup(token_iter& it);
122  int EvaluateScan(token_iter& it, token_iter& it_end);
123 
130  int ScanLessThan(std::string scan);
137  int ScanGreaterThan(std::string scan);
145  int ScanInBetween(std::string scan_low, std::string scan_high);
146 
153  int EvaluateBooleanOps(std::list< int > states);
154 
155  std::string fDelim; //baseline station delimiter: "-"
156 
157  std::string fWildcard;
158 
159  std::string fBaselineMk4;
160  std::string fRefStationMk4ID;
161  std::string fRemStationMk4ID;
162 
163  std::string fCanonicalRefStation;
164  std::string fCanonicalRemStation;
165 
166  std::string fSource;
167  std::string fFGroup;
168  std::string fScanTime;
169 
170  std::size_t fStartLineNumber;
171 };
172 
173 } // namespace hops
174 
175 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
evaluates conditional statements encounterd in control file syntax
Definition: MHO_ControlConditionEvaluator.hh:25
bool Evaluate(mho_json &control_condition)
Evaluates a single condition from an mho_json object and returns the result as a boolean.
Definition: MHO_ControlConditionEvaluator.cc:93
void SetPassInformation(std::string baseline, std::string source, std::string fgroup, std::string scan_time)
Setter for pass (baseline, source, frequency group, scan) information.
Definition: MHO_ControlConditionEvaluator.cc:35
MHO_ControlConditionEvaluator()
Definition: MHO_ControlConditionEvaluator.cc:18
mho_json GetApplicableStatements(mho_json &control_contents)
reduces the contents of a control file to only those statements which are applicable for this pass
Definition: MHO_ControlConditionEvaluator.cc:65
virtual ~MHO_ControlConditionEvaluator()
Definition: MHO_ControlConditionEvaluator.cc:32
int baseline
Definition: fourfit3.c:62
Definition: MHO_AdhocFlagging.hh:18
Definition: vex.h:103