F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
MeasurementStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title MeasurementStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for MeasurementStatus enum
5 // ======================================================================
6 
7 #ifndef Svc_MeasurementStatusEnumAc_HPP
8 #define Svc_MeasurementStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
34  OK = 0,
36  FAILURE = 1,
38  STALE = 2,
39  };
40 
42  using t = enum T;
43 
44  public:
45 
46  // ----------------------------------------------------------------------
47  // Constants
48  // ----------------------------------------------------------------------
49 
50  enum {
55  };
56 
57  public:
58 
59  // ----------------------------------------------------------------------
60  // Constructors
61  // ----------------------------------------------------------------------
62 
65  {
66  this->e = OK;
67  }
68 
71  const enum T e1
72  )
73  {
74  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
75  this->e = e1;
76  }
77 
80  const SerialType e1
81  )
82  {
83  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
84  this->e = static_cast<enum T>(e1);
85  }
86 
89  const MeasurementStatus& obj
90  )
91  {
92  this->e = obj.e;
93 #ifdef BUILD_UT
94  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
95  this->m_serializeValue = obj.m_serializeValue;
96 #endif
97  }
98 
99  public:
100 
101  // ----------------------------------------------------------------------
102  // Operators
103  // ----------------------------------------------------------------------
104 
107  const MeasurementStatus& obj
108  );
109 
112  SerialType e1
113  );
114 
117  enum T e1
118  );
119 
121  operator enum T() const
122  {
123  return this->e;
124  }
125 
127  bool operator==(enum T e1) const
128  {
129  return this->e == e1;
130  }
131 
133  bool operator!=(enum T e1) const
134  {
135  return !(*this == e1);
136  }
137 
138 #ifdef BUILD_UT
139 
141  friend std::ostream& operator<<(
142  std::ostream& os,
143  const MeasurementStatus& obj
144  );
145 
146 #endif
147 
148  public:
149 
150  // ----------------------------------------------------------------------
151  // Member functions
152  // ----------------------------------------------------------------------
153 
155  bool isValid() const;
156 
159  Fw::SerialBufferBase& buffer,
161  ) const;
162 
165  Fw::SerialBufferBase& buffer,
167  );
168 
169 #if FW_SERIALIZABLE_TO_STRING
170 
172  void toString(
173  Fw::StringBase& sb
174  ) const;
175 
176 #endif
177 
178 #ifdef BUILD_UT
179 
181  void setSerializeValue(
182  SerialType serializeValue
183  );
184 
185 #endif
186 
187  public:
188 
189  // ----------------------------------------------------------------------
190  // Static functions
191  // ----------------------------------------------------------------------
192 
194  static bool isValid(
195  SerialType serialTypeValue
196  );
197 
198  public:
199 
200  // ----------------------------------------------------------------------
201  // Public member variables
202  // ----------------------------------------------------------------------
203 
205  enum T e;
206 
207  private:
208 
209  // ----------------------------------------------------------------------
210  // Private member variables
211  // ----------------------------------------------------------------------
212 
213 #ifdef BUILD_UT
214 
220  bool m_serializeValueIsSet = false;
221 
223  SerialType m_serializeValue = 0;
224 
225 #endif
226 
227  };
228 
229 }
230 
231 #endif
enum T t
For backwards compatibility.
MeasurementStatus & operator=(const MeasurementStatus &obj)
Copy assignment operator (object)
MeasurementStatus()
Constructor (default value of OK)
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
SerializeStatus
forward declaration for string
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
The number of enumerated constants.
An enumeration for measurement status.
MeasurementStatus(const MeasurementStatus &obj)
Copy constructor.
bool operator!=(enum T e1) const
Inequality operator.
MeasurementStatus(const SerialType e1)
Constructor (serial representation value)
enum T e
The raw enum value.
Failure to retrieve measurement.
U8 SerialType
The serial representation type.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
bool operator==(enum T e1) const
Equality operator.
RateGroupDivider component implementation.
The size of the serial representation.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
MeasurementStatus(const enum T e1)
Constructor (user-provided value)
Big endian serialization.