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 DeserialStatus& obj
84  )
85  {
86  this->e = obj.e;
87 #ifdef BUILD_UT
88  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
89  this->m_serializeValue = obj.m_serializeValue;
90 #endif
91  }
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Operators
97  // ----------------------------------------------------------------------
98 
101  const DeserialStatus& obj
102  );
103 
106  enum T e1
107  );
108 
110  operator enum T() const
111  {
112  return this->e;
113  }
114 
116  bool operator==(enum T e1) const
117  {
118  return this->e == e1;
119  }
120 
122  bool operator!=(enum T e1) const
123  {
124  return !(*this == e1);
125  }
126 
127 #ifdef BUILD_UT
128 
130  friend std::ostream& operator<<(
131  std::ostream& os,
132  const DeserialStatus& obj
133  );
134 
135 #endif
136 
137  public:
138 
139  // ----------------------------------------------------------------------
140  // Member functions
141  // ----------------------------------------------------------------------
142 
144  bool isValid() const;
145 
148  Fw::SerialBufferBase& buffer,
150  ) const;
151 
154  Fw::SerialBufferBase& buffer,
156  );
157 
158 #if FW_SERIALIZABLE_TO_STRING
159 
161  void toString(
162  Fw::StringBase& sb
163  ) const;
164 
165 #endif
166 
167 #ifdef BUILD_UT
168 
170  void setSerializeValue(
171  SerialType serializeValue
172  );
173 
174 #endif
175 
176  public:
177 
178  // ----------------------------------------------------------------------
179  // Static functions
180  // ----------------------------------------------------------------------
181 
183  static bool isValid(
184  SerialType serialTypeValue
185  );
186 
187  public:
188 
189  // ----------------------------------------------------------------------
190  // Public member variables
191  // ----------------------------------------------------------------------
192 
194  enum T e;
195 
196  private:
197 
198  // ----------------------------------------------------------------------
199  // Private member variables
200  // ----------------------------------------------------------------------
201 
202 #ifdef BUILD_UT
203 
209  bool m_serializeValueIsSet = false;
210 
212  SerialType m_serializeValue = 0;
213 
214 #endif
215 
216  };
217 
218 }
219 
220 #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 size of the serial representation.
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.
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 number of enumerated constants.
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)