F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CompletedEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CompletedEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Completed enum
5 // ======================================================================
6 
7 #ifndef Fw_CompletedEnumAc_HPP
8 #define Fw_CompletedEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Fw {
16 
17  class Completed :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  using SerialType = U8;
29 
31  enum T {
33  COMPLETED = 0,
35  CANCELED = 1,
37  FAILED = 2,
38  };
39 
41  using t = enum T;
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
49  enum {
54  };
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Constructors
60  // ----------------------------------------------------------------------
61 
64  {
65  this->e = COMPLETED;
66  }
67 
70  const enum T e1
71  )
72  {
73  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
74  this->e = e1;
75  }
76 
79  const Completed& obj
80  )
81  {
82  this->e = obj.e;
83 #ifdef BUILD_UT
84  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
85  this->m_serializeValue = obj.m_serializeValue;
86 #endif
87  }
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Operators
93  // ----------------------------------------------------------------------
94 
97  const Completed& obj
98  );
99 
102  enum T e1
103  );
104 
106  operator enum T() const
107  {
108  return this->e;
109  }
110 
112  bool operator==(enum T e1) const
113  {
114  return this->e == e1;
115  }
116 
118  bool operator!=(enum T e1) const
119  {
120  return !(*this == e1);
121  }
122 
123 #ifdef BUILD_UT
124 
126  friend std::ostream& operator<<(
127  std::ostream& os,
128  const Completed& obj
129  );
130 
131 #endif
132 
133  public:
134 
135  // ----------------------------------------------------------------------
136  // Member functions
137  // ----------------------------------------------------------------------
138 
140  bool isValid() const;
141 
144  Fw::SerialBufferBase& buffer,
146  ) const;
147 
150  Fw::SerialBufferBase& buffer,
152  );
153 
154 #if FW_SERIALIZABLE_TO_STRING
155 
157  void toString(
158  Fw::StringBase& sb
159  ) const;
160 
161 #endif
162 
163 #ifdef BUILD_UT
164 
166  void setSerializeValue(
167  SerialType serializeValue
168  );
169 
170 #endif
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Static functions
176  // ----------------------------------------------------------------------
177 
179  static bool isValid(
180  SerialType serialTypeValue
181  );
182 
183  public:
184 
185  // ----------------------------------------------------------------------
186  // Public member variables
187  // ----------------------------------------------------------------------
188 
190  enum T e;
191 
192  private:
193 
194  // ----------------------------------------------------------------------
195  // Private member variables
196  // ----------------------------------------------------------------------
197 
198 #ifdef BUILD_UT
199 
205  bool m_serializeValueIsSet = false;
206 
208  SerialType m_serializeValue = 0;
209 
210 #endif
211 
212  };
213 
214 }
215 
216 #endif
Failed to complete.
enum T e
The raw enum value.
Completed & operator=(const Completed &obj)
Copy assignment operator (object)
Canceled before completion.
Completed successfully.
SerializeStatus
forward declaration for string
enum T t
For backwards compatibility.
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Completed()
Constructor (default value of COMPLETED)
The number of enumerated constants.
The size of the serial representation.
bool operator!=(enum T e1) const
Inequality operator.
Completed(const Completed &obj)
Copy constructor.
T
The raw enum type.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Completed(const enum T e1)
Constructor (user-provided value)
bool operator==(enum T e1) const
Equality operator.
Implementation of malloc based allocator.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 SerialType
The serial representation type.
Big endian serialization.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.