HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEOutputJsonMessage.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_OUTPUT_JSON_MESSAGE_HPP
15 #define DRCE_OUTPUT_JSON_MESSAGE_HPP
16 
17 #include <iostream>
18 
19 #include "DRCEJsonMessageConst.hpp"
20 #include "JsonSerializable.hpp"
21 
22 namespace HCE
23 {
24 namespace drce
25 {
26 //-----------------------------------------------------------------------------
28 {
29 public:
30  explicit DRCEOutputJsonMessage(const std::string& json="");
31  virtual ~DRCEOutputJsonMessage(void) {}
32 
33  bool serialize(std::string& json);
34  bool unserialize(const std::string& json);
35 
36  void clear(void);
37 
38  void setErrorMessage(const std::string& errorMessage_) {errorMessage=errorMessage_;}
39  std::string getErrorMessage(void) const {return errorMessage;}
40 
41  void setTime(size_t time_) {time=time_;}
42  size_t getTime(void) const {return time;}
43 
44  void setData(const std::string& data_) {data=data_;}
45  std::string getData(void) const {return data;}
46 
47 private:
48  std::string errorMessage;
49  size_t time;
50  std::string data;
51 private:
52  friend std::istream& operator>>(std::istream& is, DRCEOutputJsonMessage& outputJsonMessage);
53  friend std::ostream& operator<<(std::ostream& os, const DRCEOutputJsonMessage& outputJsonMessage);
54  typedef IJsonSerializable inherited;
55 };
56 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 } // namespace drce
59 } // namespace HCE
60 
61 #endif // DRCE_OUTPUT_JSON_MESSAGE_HPP