F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
StatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title StatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Status enum
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_Cfdp_StatusEnumAc_HPP
8 #define Svc_Ccsds_Cfdp_StatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
17  namespace Ccsds {
18 
19  namespace Cfdp {
20 
21  class Status :
22  public Fw::Serializable
23  {
24 
25  public:
26 
27  // ----------------------------------------------------------------------
28  // Types
29  // ----------------------------------------------------------------------
30 
32  using SerialType = I32;
33 
35  enum T {
37  SUCCESS = 0,
39  ERROR = 1,
50  };
51 
53  using t = enum T;
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Constants
59  // ----------------------------------------------------------------------
60 
61  enum {
66  };
67 
68  public:
69 
70  // ----------------------------------------------------------------------
71  // Constructors
72  // ----------------------------------------------------------------------
73 
76  {
77  this->e = SUCCESS;
78  }
79 
82  const enum T e1
83  )
84  {
85  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
86  this->e = e1;
87  }
88 
91  const SerialType e1
92  )
93  {
94  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
95  this->e = static_cast<enum T>(e1);
96  }
97 
100  const Status& obj
101  )
102  {
103  this->e = obj.e;
104 #ifdef BUILD_UT
105  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
106  this->m_serializeValue = obj.m_serializeValue;
107 #endif
108  }
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Operators
114  // ----------------------------------------------------------------------
115 
117  Status& operator=(
118  const Status& obj
119  );
120 
122  Status& operator=(
123  SerialType e1
124  );
125 
127  Status& operator=(
128  enum T e1
129  );
130 
132  operator enum T() const
133  {
134  return this->e;
135  }
136 
138  bool operator==(enum T e1) const
139  {
140  return this->e == e1;
141  }
142 
144  bool operator!=(enum T e1) const
145  {
146  return !(*this == e1);
147  }
148 
149 #ifdef BUILD_UT
150 
152  friend std::ostream& operator<<(
153  std::ostream& os,
154  const Status& obj
155  );
156 
157 #endif
158 
159  public:
160 
161  // ----------------------------------------------------------------------
162  // Member functions
163  // ----------------------------------------------------------------------
164 
166  bool isValid() const;
167 
170  Fw::SerialBufferBase& buffer,
172  ) const;
173 
176  Fw::SerialBufferBase& buffer,
178  );
179 
180 #if FW_SERIALIZABLE_TO_STRING
181 
183  void toString(
184  Fw::StringBase& sb
185  ) const;
186 
187 #endif
188 
189 #ifdef BUILD_UT
190 
192  void setSerializeValue(
193  SerialType serializeValue
194  );
195 
196 #endif
197 
198  public:
199 
200  // ----------------------------------------------------------------------
201  // Static functions
202  // ----------------------------------------------------------------------
203 
205  static bool isValid(
206  SerialType serialTypeValue
207  );
208 
209  public:
210 
211  // ----------------------------------------------------------------------
212  // Public member variables
213  // ----------------------------------------------------------------------
214 
216  enum T e;
217 
218  private:
219 
220  // ----------------------------------------------------------------------
221  // Private member variables
222  // ----------------------------------------------------------------------
223 
224 #ifdef BUILD_UT
225 
231  bool m_serializeValueIsSet = false;
232 
234  SerialType m_serializeValue = 0;
235 
236 #endif
237 
238  };
239 
240  }
241 
242  }
243 
244 }
245 
246 #endif
Status()
Constructor (default value of SUCCESS)
Status(const SerialType e1)
Constructor (serial representation value)
Receive PDU: Invalid EOF packet.
enum T t
For backwards compatibility.
I32 SerialType
The serial representation type.
T
The raw enum type.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
SerializeStatus
forward declaration for string
enum T e
The raw enum value.
Status(const enum T e1)
Constructor (user-provided value)
bool isValid() const
Check raw enum value for validity.
The size of the serial representation.
Generic CFDP error return code.
Receive PDU: EOF file size mismatch.
CFDP operation has been successful.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Status(const Status &obj)
Copy constructor.
RateGroupDivider component implementation.
bool operator!=(enum T e1) const
Inequality operator.
Endianness
Send PDU: No send buffer available, throttling limit reached.
bool operator==(enum T e1) const
Equality operator.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Status & operator=(const Status &obj)
Copy assignment operator (object)
The number of enumerated constants.
Big endian serialization.