hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEResultData.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_RESULT_DATA_HPP
15 #define DRCE_RESULT_DATA_HPP
16 
17 #include <map>
18 
19 #include "DRCEFilesList.hpp"
20 #include "DRCETaskRequest.hpp"
21 #include "DRCESubtasksList.hpp"
22 
23 namespace HCE
24 {
25 namespace drce
26 {
27 //-----------------------------------------------------------------------------
28 class DRCEResultDataItem : public DRCEFilesList, public DRCESubtasksList <DRCEResultDataItem>
29 {
30 public:
31  DRCEResultDataItem(void);
35 
38 
39  void setErrorCode(unsigned int errorCode_) {errorCode=errorCode_;}
40  unsigned int getErrorCode(void) const {return errorCode;}
41 
42  void setErrorMessage(const std::string& errorMessage_) {errorMessage=errorMessage_;}
43  std::string getErrorMessage(void) const {return errorMessage;}
44 
45  void setRequestId(unsigned int requestId_) {requestId=requestId_;}
46  unsigned int getRequestId(void) const {return requestId;}
47 
48  void setRequestType(DRCETaskRequest::RequestType requestType_) {requestType=requestType_;}
49  DRCETaskRequest::RequestType getRequestType(void) const {return requestType;}
50 
51  void setNodeHost(const std::string& nodeHost_) {nodeHost=nodeHost_;}
52  std::string getNodeHost(void) const {return nodeHost;}
53 
54  void setNodePort(const std::string& nodePort_) {nodePort=nodePort_;}
55  std::string getNodePort(void) const {return nodePort;}
56 
57  void setState(unsigned int state_) {state=state_;}
58  unsigned int getState(void) const {return state;}
59 
60  void setPid(unsigned int pid_) {pid=pid_;}
61  unsigned int getPid(void) const {return pid;}
62 
63  void setStdoutStream(const std::string& stdoutStream_) {stdoutStream=stdoutStream_;}
64  std::string getStdoutStream(void) const {return stdoutStream;}
65 
66  void setStderrStream(const std::string& stderrStream_) {stderrStream=stderrStream_;}
67  std::string getStderrStream(void) const {return stderrStream;}
68 
69  void setNodeName(const std::string& nodeName_) {nodeName=nodeName_;}
70  std::string getNodeName(void) const {return nodeName;}
71 
72  void setTime(unsigned int time_) {time=time_;}
73  unsigned int getTime(void) const {return time;}
74 
75  void setExitStatus(unsigned int exitStatus_) {exitStatus=exitStatus_;}
76  unsigned int getExitStatus(void) const {return exitStatus;}
77 
78  void setFields(const std::map<std::string, std::string>& fields_) {fields=fields_;}
79  const std::map<std::string, std::string>& getFields(void) const {return fields;}
80 
81  void clear(void);
82 private:
83  unsigned int errorCode;
84  std::string errorMessage;
85  unsigned int requestId;
86  DRCETaskRequest::RequestType requestType;
87  std::string nodeHost;
88  std::string nodePort;
89  unsigned int state;
90  unsigned int pid;
91  std::string stdoutStream;
92  std::string stderrStream;
93  std::string nodeName;
94  unsigned int time;
95  unsigned int exitStatus;
96  std::map<std::string, std::string> fields;
97 };
98 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
101 {
102 public:
103  DRCEResultData(void);
104  DRCEResultData(const DRCEResultData& rhs);
107 
110 
111  void addDataItem(const DRCEResultDataItem& dataItem);
112  void addDataItem(DRCEResultDataItem&& dataItem);
113 
114  const std::vector<DRCEResultDataItem>& getItems(void) const {return items;}
115 
116  size_t getItemsCount(void) const;
117  const DRCEResultDataItem& getDataItem(size_t index) const;
118  void setDataItem(size_t index, const DRCEResultDataItem& dataItem);
119  void setDataItem(size_t index, DRCEResultDataItem&& dataItem);
120 
121  void clear(void);
122 private:
123  std::vector<DRCEResultDataItem> items;
124 
125  typedef DRCEFilesList inherited;
126 };
127 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 } // namespace drce
130 } // namespace HCE
131 
132 #endif // DRCE_RESULT_DATA_HPP