libepp_nicbr
LaunchCheckCmd.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id$ */
7 #ifndef __LAUNCH_CHECK_CMD_H__
8 #define __LAUNCH_CHECK_CMD_H__
9 
10 #include <string>
11 
12 #include "Launch.H"
13 
14 using std::string;
15 
16 LIBEPP_NICBR_NS_BEGIN
17 
20 {
21 public:
23  class Type
24  {
25  public:
27  enum Value {
28  NONE,
29  CLAIMS,
30  AVAIL
31  };
32 
34 
38  static string toStr(const Value value)
39  {
40  switch (value) {
41  case NONE:
42  break;
43  case CLAIMS:
44  return "claims";
45  case AVAIL:
46  return "avail";
47  }
48 
49  return "";
50  }
51 
53 
57  static Value fromStr(const string &value)
58  {
59  if (value == "claims") {
60  return CLAIMS;
61 
62  } else if (value == "avail") {
63  return AVAIL;
64  }
65 
66  return NONE;
67  }
68  };
69 
70  // Default constructor
72  {
73  reset();
74  }
75 
77 
80  void set_type(const Type::Value type) { _type = type; }
81 
83 
86  Type::Value get_type() const { return _type; }
87 
89 
92  void set_phase(const LaunchPhase &phase) { _phase = phase; }
93 
95 
98  LaunchPhase get_phase() const { return _phase; }
99 
101  void reset()
102  {
103  _type = Type::NONE;
104  _phase.reset();
105  }
106 
107 private:
109  Type::Value _type;
110 
112  LaunchPhase _phase;
113 };
114 
115 LIBEPP_NICBR_NS_END
116 
117 #endif // __LAUNCH_CHECK_CMD_H__
Type::Value get_type() const
Returns the expected type of object.
Definition: LaunchCheckCmd.H:86
EPP Launch Phase Class.
Definition: Launch.H:121
static Value fromStr(const string &value)
Convert text type to value.
Definition: LaunchCheckCmd.H:57
void set_type(const Type::Value type)
Sets the expected type of object.
Definition: LaunchCheckCmd.H:80
Value
Possible type values.
Definition: LaunchCheckCmd.H:27
void reset()
Reset object attributes.
Definition: Launch.H:236
void reset()
Reset object attributes.
Definition: LaunchCheckCmd.H:101
LaunchPhase get_phase() const
Returns the phase of the launch.
Definition: LaunchCheckCmd.H:98
void set_phase(const LaunchPhase &phase)
Sets the phase of the launch.
Definition: LaunchCheckCmd.H:92
EPP LaunchCheckCmd::Type Class.
Definition: LaunchCheckCmd.H:23
static string toStr(const Value value)
Convert type to text format.
Definition: LaunchCheckCmd.H:38
EPP LaunchCheckCmd Class.
Definition: LaunchCheckCmd.H:19
EPP Launch Phase.