F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
CmdResponseEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdResponseEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CmdResponse enum
5 // ======================================================================
6 
7 #ifndef Fw_CmdResponseEnumAc_HPP
8 #define Fw_CmdResponseEnumAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Fw {
15 
17  class CmdResponse :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef I32 SerialType;
29 
31  enum T {
33  OK = 0,
43  BUSY = 5,
44  };
45 
47  typedef T t;
48 
49  public:
50 
51  // ----------------------------------------------------------------------
52  // Constants
53  // ----------------------------------------------------------------------
54 
55  enum {
60  };
61 
62  public:
63 
64  // ----------------------------------------------------------------------
65  // Constructors
66  // ----------------------------------------------------------------------
67 
70  {
71  this->e = OK;
72  }
73 
76  const T e1
77  )
78  {
79  this->e = e1;
80  }
81 
84  const CmdResponse& obj
85  )
86  {
87  this->e = obj.e;
88  }
89 
90  public:
91 
92  // ----------------------------------------------------------------------
93  // Operators
94  // ----------------------------------------------------------------------
95 
98  const CmdResponse& obj
99  );
100 
103  T e1
104  );
105 
107  operator T() const
108  {
109  return this->e;
110  }
111 
113  bool operator==(T e1) const
114  {
115  return this->e == e1;
116  }
117 
119  bool operator!=(T e1) const
120  {
121  return !(*this == e1);
122  }
123 
124 #ifdef BUILD_UT
125 
127  friend std::ostream& operator<<(
128  std::ostream& os,
129  const CmdResponse& obj
130  );
131 
132 #endif
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Member functions
138  // ----------------------------------------------------------------------
139 
141  bool isValid() const;
142 
145  Fw::SerializeBufferBase& buffer
146  ) const;
147 
150  Fw::SerializeBufferBase& buffer
151  );
152 
153 #if FW_SERIALIZABLE_TO_STRING
154 
156  void toString(
157  Fw::StringBase& sb
158  ) const;
159 
160 #endif
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Member variables
166  // ----------------------------------------------------------------------
167 
169  T e;
170 
171  };
172 
173 }
174 
175 #endif
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
CmdResponse()
Constructor (default value of OK)
bool isValid() const
Check raw enum value for validity.
T
The raw enum type.
@ FORMAT_ERROR
Command failed to deserialize.
@ EXECUTION_ERROR
Command had execution error.
@ VALIDATION_ERROR
Command failed validation.
@ OK
Command successfully executed.
@ BUSY
Component busy.
@ INVALID_OPCODE
Invalid opcode dispatched.
CmdResponse(const T e1)
Constructor (user-provided value)
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
@ SERIALIZED_SIZE
The size of the serial representation.
@ NUM_CONSTANTS
The number of enumerated constants.
bool operator==(T e1) const
Equality operator.
T e
The raw enum value.
CmdResponse & operator=(const CmdResponse &obj)
Copy assignment operator (object)
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
CmdResponse(const CmdResponse &obj)
Copy constructor.
bool operator!=(T e1) const
Inequality operator.
T t
For backwards compatibility.
I32 SerialType
The serial representation type.
forward declaration
SerializeStatus
forward declaration for string