CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataPoint.h
Go to the documentation of this file.
1 /*
2  * DataPoint.h
3  *
4  * Created on: Sep 24, 2012
5  * Author: aspataru
6  */
7 
8 #ifndef DATAPOINT_H_
9 #define DATAPOINT_H_
10 
11 #include <string>
12 #include <vector>
13 #include <stdint.h>
14 #include "JsonSerializable.h"
15 
16 namespace jsoncollector {
17 class DataPoint: public JsonSerializable {
18 
19 public:
20  DataPoint();
22  const std::vector<std::string>& data);
23  virtual ~DataPoint();
24 
28  virtual void serialize(Json::Value& root) const;
32  virtual void deserialize(Json::Value& root);
33 
35  return source_;
36  }
38  return definition_;
39  }
40  std::vector<std::string> getData() const {
41  return data_;
42  }
43 
44  void setSource(std::string source) {
45  source_ = source;
46  }
47  void setDefinition(std::string definition) {
48  definition_ = definition;
49  }
50  void addToData(std::string data) {
51  data_.push_back(data);
52  }
53  void resetData() {
54  data_.clear();
55  }
56 
57  // JSON field names
58  static const std::string SOURCE;
59  static const std::string DEFINITION;
60  static const std::string DATA;
61 
62 protected:
64  std::vector<std::string> data_;
65 
66 };
67 }
68 
69 #endif /* DATAPOINT_H_ */
static const std::string DEFINITION
Definition: DataPoint.h:59
virtual void serialize(Json::Value &root) const
Definition: DataPoint.cc:29
static const std::string DATA
Definition: DataPoint.h:60
Represents a JSON value.
Definition: value.h:111
void addToData(std::string data)
Definition: DataPoint.h:50
std::string definition_
Definition: DataPoint.h:63
std::vector< std::string > data_
Definition: DataPoint.h:64
void setDefinition(std::string definition)
Definition: DataPoint.h:47
std::string getDefinition() const
Definition: DataPoint.h:37
virtual void deserialize(Json::Value &root)
Definition: DataPoint.cc:36
std::vector< std::string > getData() const
Definition: DataPoint.h:40
void setSource(std::string source)
Definition: DataPoint.h:44
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string getSource() const
Definition: DataPoint.h:34
static std::string const source
Definition: EdmProvDump.cc:43
static const std::string SOURCE
Definition: DataPoint.h:58
string root
initialization
Definition: dbtoconf.py:70