libepp_nicbr
LaunchInfoRsp.H
1 /* ${copyright}$ */
2 /* $Id$ */
7 #ifndef __LAUNCH_INFO_RSP_H__
8 #define __LAUNCH_INFO_RSP_H__
9 
10 #include <list>
11 #include <string>
12 
13 #include "Launch.H"
14 
15 using std::list;
16 using std::string;
17 
18 LIBEPP_NICBR_NS_BEGIN
19 
22 {
23 public:
25  class Status
26  {
27  public:
29  enum Value {
30  NONE,
31  PENDING_VALIDATION,
32  VALIDATED,
33  INVALID,
34  PENDING_ALLOCATION,
35  ALLOCATED,
36  REJECTED,
37  CUSTOM
38  };
39 
41 
45  static string toStr(const Value value)
46  {
47  switch (value) {
48  case NONE:
49  break;
50  case PENDING_VALIDATION:
51  return "pendingValidation";
52  case VALIDATED:
53  return "validated";
54  case INVALID:
55  return "invalid";
56  case PENDING_ALLOCATION:
57  return "pendingAllocation";
58  case ALLOCATED:
59  return "allocated";
60  case REJECTED:
61  return "rejected";
62  case CUSTOM:
63  return "custom";
64  }
65 
66  return "";
67  }
68 
70 
74  static Value fromStr(const string &value)
75  {
76  if (value == "pendingValidation") {
77  return PENDING_VALIDATION;
78 
79  } else if (value == "validated") {
80  return VALIDATED;
81 
82  } else if (value == "invalid") {
83  return INVALID;
84 
85  } else if (value == "pendingAllocation") {
86  return PENDING_ALLOCATION;
87 
88  } else if (value == "allocated") {
89  return ALLOCATED;
90 
91  } else if (value == "rejected") {
92  return REJECTED;
93 
94  } else if (value == "custom") {
95  return CUSTOM;
96  }
97 
98  return NONE;
99  }
100  };
101 
104  {
105  reset();
106  }
107 
109 
112  void set_phase(const LaunchPhase &phase) { _phase = phase; }
113 
115 
118  LaunchPhase get_phase() const { return _phase; }
119 
121 
125  void set_applicationId(const string &applicationId) { _applicationId = applicationId; }
126 
128 
131  string get_applicationId() const { return _applicationId; }
132 
134 
137  void set_status(const Status::Value status) { _status = status; }
138 
140 
143  Status::Value get_status() const { return _status; }
144 
146 
149  void set_marks(const list<SMDMark> &marks) { _marks = marks; }
150 
152 
155  void add_mark(const SMDMark &mark) { _marks.push_back(mark); }
156 
158 
161  list<SMDMark> get_marks() const { return _marks; }
162 
164  void reset()
165  {
166  _phase.reset();
167  _applicationId.clear();
168  _status = Status::NONE;
169  _marks.clear();
170  }
171 
172 private:
174  LaunchPhase _phase;
175 
177  string _applicationId;
178 
180  Status::Value _status;
181 
183  list<SMDMark> _marks;
184 };
185 
186 LIBEPP_NICBR_NS_END
187 
188 #endif // __LAUNCH_INFO_RSP_H__
Value
Possible launch info response status.
Definition: LaunchInfoRsp.H:29
EPP Launch Phase Class.
Definition: Launch.H:121
EPP LaunchInfoRsp::Status Class.
Definition: LaunchInfoRsp.H:25
void set_marks(const list< SMDMark > &marks)
Sets the list of marks.
Definition: LaunchInfoRsp.H:149
list< SMDMark > get_marks() const
Returns the list of marks.
Definition: LaunchInfoRsp.H:161
void set_phase(const LaunchPhase &phase)
Sets the phase of the launch.
Definition: LaunchInfoRsp.H:112
EPP SMDMark Class.
Definition: SMD.H:1244
void add_mark(const SMDMark &mark)
Add a mark.
Definition: LaunchInfoRsp.H:155
void reset()
Reset object attributes.
Definition: Launch.H:236
static string toStr(const Value value)
Convert status to text format.
Definition: LaunchInfoRsp.H:45
EPP LaunchInfoRsp Class.
Definition: LaunchInfoRsp.H:21
void set_status(const Status::Value status)
Sets the status of the Launch Application.
Definition: LaunchInfoRsp.H:137
Status::Value get_status() const
Returns the status of the Launch Application.
Definition: LaunchInfoRsp.H:143
void reset()
Reset object attributes.
Definition: LaunchInfoRsp.H:164
LaunchPhase get_phase() const
Returns the phase of the launch.
Definition: LaunchInfoRsp.H:118
void set_applicationId(const string &applicationId)
Sets the application Identifier of the Launch Application.
Definition: LaunchInfoRsp.H:125
static Value fromStr(const string &value)
Convert text status to value.
Definition: LaunchInfoRsp.H:74
EPP Launch Phase.
string get_applicationId() const
Returns the application Identifier of the Launch Application.
Definition: LaunchInfoRsp.H:131
LaunchInfoRsp()
Default constructor.
Definition: LaunchInfoRsp.H:103