F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ByteStreamStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ByteStreamStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ByteStreamStatus enum
5 // ======================================================================
6 
7 #ifndef Drv_ByteStreamStatusEnumAc_HPP
8 #define Drv_ByteStreamStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Drv {
16 
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
34  OP_OK = 0,
41  };
42 
44  using t = enum T;
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
52  enum {
57  };
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Constructors
63  // ----------------------------------------------------------------------
64 
67  {
68  this->e = OP_OK;
69  }
70 
73  const enum T e1
74  )
75  {
76  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
77  this->e = e1;
78  }
79 
82  const SerialType e1
83  )
84  {
85  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
86  this->e = static_cast<enum T>(e1);
87  }
88 
91  const ByteStreamStatus& obj
92  )
93  {
94  this->e = obj.e;
95 #ifdef BUILD_UT
96  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
97  this->m_serializeValue = obj.m_serializeValue;
98 #endif
99  }
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Operators
105  // ----------------------------------------------------------------------
106 
109  const ByteStreamStatus& obj
110  );
111 
114  SerialType e1
115  );
116 
119  enum T e1
120  );
121 
123  operator enum T() const
124  {
125  return this->e;
126  }
127 
129  bool operator==(enum T e1) const
130  {
131  return this->e == e1;
132  }
133 
135  bool operator!=(enum T e1) const
136  {
137  return !(*this == e1);
138  }
139 
140 #ifdef BUILD_UT
141 
143  friend std::ostream& operator<<(
144  std::ostream& os,
145  const ByteStreamStatus& obj
146  );
147 
148 #endif
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Member functions
154  // ----------------------------------------------------------------------
155 
157  bool isValid() const;
158 
161  Fw::SerialBufferBase& buffer,
163  ) const;
164 
167  Fw::SerialBufferBase& buffer,
169  );
170 
171 #if FW_SERIALIZABLE_TO_STRING
172 
174  void toString(
175  Fw::StringBase& sb
176  ) const;
177 
178 #endif
179 
180 #ifdef BUILD_UT
181 
183  void setSerializeValue(
184  SerialType serializeValue
185  );
186 
187 #endif
188 
189  public:
190 
191  // ----------------------------------------------------------------------
192  // Static functions
193  // ----------------------------------------------------------------------
194 
196  static bool isValid(
197  SerialType serialTypeValue
198  );
199 
200  public:
201 
202  // ----------------------------------------------------------------------
203  // Public member variables
204  // ----------------------------------------------------------------------
205 
207  enum T e;
208 
209  private:
210 
211  // ----------------------------------------------------------------------
212  // Private member variables
213  // ----------------------------------------------------------------------
214 
215 #ifdef BUILD_UT
216 
222  bool m_serializeValueIsSet = false;
223 
225  SerialType m_serializeValue = 0;
226 
227 #endif
228 
229  };
230 
231 }
232 
233 #endif
enum T t
For backwards compatibility.
bool isValid() const
Check raw enum value for validity.
ByteStreamStatus()
Constructor (default value of OP_OK)
Error occurred, retrying may succeed.
The size of the serial representation.
bool operator==(enum T e1) const
Equality operator.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Receive worked, but there was no data.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
ByteStreamStatus(const enum T e1)
Constructor (user-provided value)
ByteStreamStatus(const SerialType e1)
Constructor (serial representation value)
Status returned by the send call.
Operation worked as expected.
bool operator!=(enum T e1) const
Inequality operator.
U8 SerialType
The serial representation type.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
ByteStreamStatus & operator=(const ByteStreamStatus &obj)
Copy assignment operator (object)
enum T e
The raw enum value.
The number of enumerated constants.
ByteStreamStatus(const ByteStreamStatus &obj)
Copy constructor.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.