F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DeserialStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DeserialStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DeserialStatus enum
5 // ======================================================================
6 
7 #ifndef Fw_DeserialStatusEnumAc_HPP
8 #define Fw_DeserialStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Fw {
16 
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
33  OK = 0,
42  };
43 
45  using t = enum T;
46 
47  public:
48 
49  // ----------------------------------------------------------------------
50  // Constants
51  // ----------------------------------------------------------------------
52 
53  enum {
58  };
59 
60  public:
61 
62  // ----------------------------------------------------------------------
63  // Constructors
64  // ----------------------------------------------------------------------
65 
68  {
69  this->e = OK;
70  }
71 
74  const enum T e1
75  )
76  {
77  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
78  this->e = e1;
79  }
80 
83  const SerialType e1
84  )
85  {
86  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
87  this->e = static_cast<enum T>(e1);
88  }
89 
92  const DeserialStatus& obj
93  )
94  {
95  this->e = obj.e;
96 #ifdef BUILD_UT
97  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
98  this->m_serializeValue = obj.m_serializeValue;
99 #endif
100  }
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Operators
106  // ----------------------------------------------------------------------
107 
110  const DeserialStatus& obj
111  );
112 
115  SerialType e1
116  );
117 
120  enum T e1
121  );
122 
124  operator enum T() const
125  {
126  return this->e;
127  }
128 
130  bool operator==(enum T e1) const
131  {
132  return this->e == e1;
133  }
134 
136  bool operator!=(enum T e1) const
137  {
138  return !(*this == e1);
139  }
140 
141 #ifdef BUILD_UT
142 
144  friend std::ostream& operator<<(
145  std::ostream& os,
146  const DeserialStatus& obj
147  );
148 
149 #endif
150 
151  public:
152 
153  // ----------------------------------------------------------------------
154  // Member functions
155  // ----------------------------------------------------------------------
156 
158  bool isValid() const;
159 
162  Fw::SerialBufferBase& buffer,
164  ) const;
165 
168  Fw::SerialBufferBase& buffer,
170  );
171 
172 #if FW_SERIALIZABLE_TO_STRING
173 
175  void toString(
176  Fw::StringBase& sb
177  ) const;
178 
179 #endif
180 
181 #ifdef BUILD_UT
182 
184  void setSerializeValue(
185  SerialType serializeValue
186  );
187 
188 #endif
189 
190  public:
191 
192  // ----------------------------------------------------------------------
193  // Static functions
194  // ----------------------------------------------------------------------
195 
197  static bool isValid(
198  SerialType serialTypeValue
199  );
200 
201  public:
202 
203  // ----------------------------------------------------------------------
204  // Public member variables
205  // ----------------------------------------------------------------------
206 
208  enum T e;
209 
210  private:
211 
212  // ----------------------------------------------------------------------
213  // Private member variables
214  // ----------------------------------------------------------------------
215 
216 #ifdef BUILD_UT
217 
223  bool m_serializeValueIsSet = false;
224 
226  SerialType m_serializeValue = 0;
227 
228 #endif
229 
230  };
231 
232 }
233 
234 #endif
Deserialized type ID didn&#39;t match.
Deserialization buffer was empty when trying to read data.
DeserialStatus(const DeserialStatus &obj)
Copy constructor.
Deserialization status.
U8 SerialType
The serial representation type.
enum T t
For backwards compatibility.
Deserialization data had incorrect values (unexpected data types)
The number of enumerated constants.
SerializeStatus
forward declaration for string
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
enum T e
The raw enum value.
bool operator!=(enum T e1) const
Inequality operator.
DeserialStatus(const SerialType e1)
Constructor (serial representation value)
bool isValid() const
Check raw enum value for validity.
DeserialStatus()
Constructor (default value of OK)
Data was left in in the buffer, but not enough to deserialize.
bool operator==(enum T e1) const
Equality operator.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
The size of the serial representation.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
T
The raw enum type.
Implementation of malloc based allocator.
Endianness
DeserialStatus(const enum T e1)
Constructor (user-provided value)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
DeserialStatus & operator=(const DeserialStatus &obj)
Copy assignment operator (object)