CARMA C++
AHW_Evaluator.h
1 /*
2  * AstroHeaderWriter Configuration Directive Evaluator
3  */
4 
5 #ifndef AHW_EVALUATOR
6 #define AHW_EVALUATOR
7 
8 #include <carma/sdp/AHW_Output.h>
9 #include <carma/sdp/AHW_Utils.h>
10 
13 
14 #include <carma/util/types.h>
15 #include <carma/util/CorrelatorType.h>
16 
17 #include <vector>
18 #include <string>
19 #include <map>
20 
21 namespace carma {
22 namespace sdp {
23 
24 class AHW_Evaluator
25 {
26 public:
27  AHW_Evaluator();
28 
29  /* prepare for a particular correlator + integration */
30  void prepare(const carma::util::CorrelatorType type, const carma::util::frameType frameCount, const MPValueMap &mpValues);
31 
32  /* prepare for maximum expansion: all correlators + all integration times */
33  void prepareAll();
34 
35  /* get extra monitor points used internally */
36  std::vector<std::string> getMPInternal() const;
37 
38  /* get the monitor point expansion for a particular MP name template */
39  std::vector<std::string> getMPExpansion(const AHW_Output &ao, const bool skipInvalid = false) const;
40 
41  /* write the key-value output as specified */
42  void writeKVOutput(const AHW_Output &ao, AstroHeaderElementMap &astroHdrMap) const;
43 
44 private:
45  const StringVectorMap genericVarMap;
46  const StringVectorMap genericInternalMap;
47 
48  StringVectorMap varMap;
49  StringVectorMap internalMap;
50 
51  // data saved from prepare()
52  carma::util::CorrelatorType type_;
53  carma::util::frameType frameCount_;
54  MPValueMap mpValues_;
55 
56  void runSubstitution(const std::string &mp, const StringVector &substs,
57  const bool &skipInvalid, StringVector &ret) const;
58 };
59 
60 } // namespace carma::sdp
61 } // namespace carma
62 
63 #endif /* AHW_EVALUATOR */
64 
65 /* vim: set ts=8 sts=8 sw=8 noet tw=92: */
Holds basic info on a monitor point value.
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
Various type definitions for util classes.
A class to hold the representation of an astronomical header data element.