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 SerialStatus& obj
81  )
82  {
83  this->e = obj.e;
84 #ifdef BUILD_UT
85  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
86  this->m_serializeValue = obj.m_serializeValue;
87 #endif
88  }
89 
90  public:
91 
92  // ----------------------------------------------------------------------
93  // Operators
94  // ----------------------------------------------------------------------
95 
98  const SerialStatus& obj
99  );
100 
103  enum T e1
104  );
105 
107  operator enum T() const
108  {
109  return this->e;
110  }
111 
113  bool operator==(enum T e1) const
114  {
115  return this->e == e1;
116  }
117 
119  bool operator!=(enum T e1) const
120  {
121  return !(*this == e1);
122  }
123 
124 #ifdef BUILD_UT
125 
127  friend std::ostream& operator<<(
128  std::ostream& os,
129  const SerialStatus& obj
130  );
131 
132 #endif
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Member functions
138  // ----------------------------------------------------------------------
139 
141  bool isValid() const;
142 
145  Fw::SerialBufferBase& buffer,
147  ) const;
148 
151  Fw::SerialBufferBase& buffer,
153  );
154 
155 #if FW_SERIALIZABLE_TO_STRING
156 
158  void toString(
159  Fw::StringBase& sb
160  ) const;
161 
162 #endif
163 
164 #ifdef BUILD_UT
165 
167  void setSerializeValue(
168  SerialType serializeValue
169  );
170 
171 #endif
172 
173  public:
174 
175  // ----------------------------------------------------------------------
176  // Static functions
177  // ----------------------------------------------------------------------
178 
180  static bool isValid(
181  SerialType serialTypeValue
182  );
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Public member variables
188  // ----------------------------------------------------------------------
189 
191  enum T e;
192 
193  private:
194 
195  // ----------------------------------------------------------------------
196  // Private member variables
197  // ----------------------------------------------------------------------
198 
199 #ifdef BUILD_UT
200 
206  bool m_serializeValueIsSet = false;
207 
209  SerialType m_serializeValue = 0;
210 
211 #endif
212 
213  };
214 
215 }
216 
217 #endif
The number of enumerated constants.
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.
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.
bool operator==(enum T e1) const
Equality operator.
The size of the serial representation.
Implementation of malloc based allocator.
Endianness
enum T t
For backwards compatibility.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.