CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataPointDefinition.h
Go to the documentation of this file.
1 /*
2  * DataPointDefinition.h
3  *
4  * Created on: Sep 24, 2012
5  * Author: aspataru
6  */
7 
8 #ifndef DATAPOINTDEFINITION_H_
9 #define DATAPOINTDEFINITION_H_
10 
13 #include <string>
14 #include <vector>
15 
16 namespace jsoncollector {
17 
18  class JsonMonConfig;
19 
21  public:
23 
24  //DataPointDefinition(std::string const& prefix) : namePrefix_(prefix) {}
25  //DataPointDefinition(const std::vector<std::string>& names, const std::vector<std::string>& operations);
26 
27  ~DataPointDefinition() override {}
28 
32  void serialize(Json::Value& root) const override;
36  void deserialize(Json::Value& root) override;
40  bool isPopulated() const;
44  std::vector<std::string> const& getNames() const { return varNames_; }
45  std::vector<std::string> const& getOperations() const { return opNames_; }
46 
50  static bool getDataPointDefinitionFor(std::string& defFilePath,
52  const std::string* defaultGroup = nullptr);
53 
55 
56  void addLegendItem(std::string const& name, std::string const& type, std::string const& operation);
57 
58  OperationType getOperationFor(unsigned int index) const;
59 
61  std::string const& getDefFilePath() const { return defFilePath_; }
62  //void populateMonConfig(std::vector<JsonMonConfig>& monConfig);
63 
64  //known JSON operation names
65  static const std::string SUM;
66  static const std::string AVG;
67  static const std::string SAME;
68  static const std::string HISTO;
69  static const std::string CAT;
70  static const std::string MERGE;
71  static const std::string BINARYOR;
72  static const std::string ADLER32;
73 
74  // JSON field names
75  static const std::string LEGEND;
76  static const std::string DATA;
77  static const std::string PARAM_NAME;
78  static const std::string OPERATION;
79  static const std::string TYPE;
80 
81  private:
82  std::vector<std::string> varNames_;
83  std::vector<std::string> typeNames_;
84  std::vector<std::string> opNames_;
87 
88  // std::string namePrefix_;
89  };
90 } // namespace jsoncollector
91 
92 #endif /* DATAPOINTDEFINITION_H_ */
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
void serialize(Json::Value &root) const override
std::vector< std::string > const & getOperations() const
static const std::string PARAM_NAME
Represents a JSON value.
Definition: value.h:99
std::vector< std::string > const & getNames() const
std::string const & getDefFilePath() const
static bool getDataPointDefinitionFor(std::string &defFilePath, DataPointDefinition *dpd, const std::string *defaultGroup=nullptr)
std::vector< std::string > varNames_
std::vector< std::string > typeNames_
static const std::string OPERATION
tuple group
Definition: watchdog.py:82
OperationType getOperationFor(unsigned int index) const
void deserialize(Json::Value &root) override
void setDefaultGroup(std::string const &group)
std::vector< std::string > opNames_