F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SerialStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SerialStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SerialStatus enum
5 // ======================================================================
6 
7 #ifndef Fw_SerialStatusEnumAc_HPP
8 #define Fw_SerialStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Fw {
16 
18  class SerialStatus :
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,
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 SerialStatus& 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 SerialStatus& 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 SerialStatus& 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
SerialStatus(const SerialType e1)
Constructor (serial representation value)
Serialization operation succeeded.
SerialStatus(const enum T e1)
Constructor (user-provided value)
SerialStatus()
Constructor (default value of OK)
bool operator!=(enum T e1) const
Inequality operator.
The number of enumerated constants.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Serialization status.
SerializeStatus
forward declaration for string
U8 SerialType
The serial representation type.
No room left in the buffer to serialize data.
bool isValid() const
Check raw enum value for validity.
T
The raw enum type.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
SerialStatus & operator=(const SerialStatus &obj)
Copy assignment operator (object)
enum T e
The raw enum value.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Data was the wrong format (e.g. wrong packet type)
SerialStatus(const SerialStatus &obj)
Copy constructor.
The size of the serial representation.
bool operator==(enum T e1) const
Equality operator.
Implementation of malloc based allocator.
Endianness
enum T t
For backwards compatibility.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.