CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
22 public:
24 
25  //DataPointDefinition(std::string const& prefix) : namePrefix_(prefix) {}
26  //DataPointDefinition(const std::vector<std::string>& names, const std::vector<std::string>& operations);
27 
28  virtual ~DataPointDefinition() {}
29 
33  virtual void serialize(Json::Value& root) const;
37  virtual void deserialize(Json::Value& root);
41  bool isPopulated() const;
45  std::vector<std::string> const& getNames() {return varNames_;}
46  std::vector<std::string> const& getOperations() {return opNames_;}
47 
51  static bool getDataPointDefinitionFor(std::string& defFilePath, DataPointDefinition* dpd, const std::string *defaultGroup=nullptr);
52 
54 
55  void addLegendItem(std::string const& name, std::string const& type, std::string const& operation);
56 
57  OperationType getOperationFor(unsigned int index);
58 
60  //void populateMonConfig(std::vector<JsonMonConfig>& monConfig);
61 
62  //known JSON operation names
63  static const std::string SUM;
64  static const std::string AVG;
65  static const std::string SAME;
66  static const std::string HISTO;
67  static const std::string CAT;
68  static const std::string MERGE;
69  static const std::string BINARYOR;
70  static const std::string ADLER32;
71 
72  // JSON field names
73  static const std::string LEGEND;
74  static const std::string DATA;
75  static const std::string PARAM_NAME;
76  static const std::string OPERATION;
77  static const std::string TYPE;
78 
79 private:
80  std::vector<std::string> varNames_;
81  std::vector<std::string> typeNames_;
82  std::vector<std::string> opNames_;
85 
86 // std::string namePrefix_;
87 };
88 }
89 
90 #endif /* DATAPOINTDEFINITION_H_ */
type
Definition: HCALResponse.h:21
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
virtual void deserialize(Json::Value &root)
OperationType getOperationFor(unsigned int index)
static const std::string PARAM_NAME
Represents a JSON value.
Definition: value.h:111
std::vector< std::string > const & getOperations()
static bool getDataPointDefinitionFor(std::string &defFilePath, DataPointDefinition *dpd, const std::string *defaultGroup=nullptr)
std::vector< std::string > varNames_
virtual void serialize(Json::Value &root) const
std::vector< std::string > typeNames_
static const std::string OPERATION
tuple group
Definition: watchdog.py:82
std::vector< std::string > const & getNames()
void setDefaultGroup(std::string const &group)
std::vector< std::string > opNames_