hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEDefaultJSON.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_DEFAULT_JSON_HPP
15 #define DRCE_DEFAULT_JSON_HPP
16 
17 #include <iostream>
18 
19 namespace HCE
20 {
21 namespace drce
22 {
23 class DRCEResultData;
24 //-----------------------------------------------------------------------------
26 {
27 public:
28  explicit DRCEDefaultJSON(unsigned int dataItemsCount=0, unsigned int filesCount=0);
30 
31  bool makeJSON(unsigned int dataItemsCount=0, unsigned int filesCount=0);
32 
33  void setJsonErrorMessage(const std::string& jsonErrorMessage_) {jsonErrorMessage=jsonErrorMessage_;}
34  std::string getJsonErrorMessage(void) const {return jsonErrorMessage;}
35 
36  void setJsonErrorCode(unsigned int jsonErrorCode_) {jsonErrorCode=jsonErrorCode_;}
37  unsigned int getJsonErrorCode(void) const {return jsonErrorCode;}
38 
39  void setJsonNodeHost(const std::string& jsonNodeHost_) {jsonNodeHost=jsonNodeHost_;}
40  std::string getJsonNodeHost(void) const {return jsonNodeHost;}
41 
42  void setJsonNodeName(const std::string& jsonNodeName_) {jsonNodeName=jsonNodeName_;}
43  std::string getJsonNodeName(void) const {return jsonNodeName;}
44 
45  void setJsonNodePort(const std::string& jsonNodePort_) {jsonNodePort=jsonNodePort_;}
46  std::string getJsonNodePort(void) const {return jsonNodePort;}
47 
48  void setJsonState(unsigned int jsonState_) {jsonState=jsonState_;}
49  unsigned int getJsonState(void) const {return jsonState;}
50 
51  void setJsonRequestType(unsigned int jsonRequestType_) {jsonRequestType=jsonRequestType_;}
52  unsigned int getJsonRequestType(void) const {return jsonRequestType;}
53 
54  const std::string& getJSON(void) const {return json;}
55  const std::string& getErrorMsg(void) const {return errorMsg;}
56  unsigned int getErrorCode(void) const {return errorCode;}
57  bool isError(void) const {return _isError;}
58 private:
59  bool fillResultData(DRCEResultData& resultData, unsigned int dataItemsCount, unsigned int filesCount);
60 private:
61  std::string json;
62  std::string errorMsg;
63  unsigned int errorCode;
64  bool _isError;
65 
66  std::string jsonErrorMessage;
67  unsigned int jsonErrorCode;
68  std::string jsonNodeHost;
69  std::string jsonNodeName;
70  std::string jsonNodePort;
71  unsigned int jsonState;
72  unsigned int jsonRequestType;
73 
74  friend std::ostream& operator<<(std::ostream& os, const DRCEDefaultJSON& defaultJson);
75 };
76 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 } // end namespace drce
79 } // end namespace HCE
80 
81 
82 #endif // DRCE_DEFAULT_JSON_HPP