F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
VersionEnumEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title VersionEnumEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for VersionEnum enum
5 // ======================================================================
6 
7 #ifndef Svc_VersionCfg_VersionEnumEnumAc_HPP
8 #define Svc_VersionCfg_VersionEnumEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
17  namespace VersionCfg {
18 
21  class VersionEnum :
22  public Fw::Serializable
23  {
24 
25  public:
26 
27  // ----------------------------------------------------------------------
28  // Types
29  // ----------------------------------------------------------------------
30 
32  using SerialType = U32;
33 
35  enum T {
56  };
57 
59  using t = enum T;
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Constants
65  // ----------------------------------------------------------------------
66 
67  enum {
72  };
73 
74  public:
75 
76  // ----------------------------------------------------------------------
77  // Constructors
78  // ----------------------------------------------------------------------
79 
82  {
83  this->e = PROJECT_VERSION_00;
84  }
85 
88  const enum T e1
89  )
90  {
91  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
92  this->e = e1;
93  }
94 
97  const SerialType e1
98  )
99  {
100  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
101  this->e = static_cast<enum T>(e1);
102  }
103 
106  const VersionEnum& obj
107  )
108  {
109  this->e = obj.e;
110 #ifdef BUILD_UT
111  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
112  this->m_serializeValue = obj.m_serializeValue;
113 #endif
114  }
115 
116  public:
117 
118  // ----------------------------------------------------------------------
119  // Operators
120  // ----------------------------------------------------------------------
121 
124  const VersionEnum& obj
125  );
126 
129  SerialType e1
130  );
131 
134  enum T e1
135  );
136 
138  operator enum T() const
139  {
140  return this->e;
141  }
142 
144  bool operator==(enum T e1) const
145  {
146  return this->e == e1;
147  }
148 
150  bool operator!=(enum T e1) const
151  {
152  return !(*this == e1);
153  }
154 
155 #ifdef BUILD_UT
156 
158  friend std::ostream& operator<<(
159  std::ostream& os,
160  const VersionEnum& obj
161  );
162 
163 #endif
164 
165  public:
166 
167  // ----------------------------------------------------------------------
168  // Member functions
169  // ----------------------------------------------------------------------
170 
172  bool isValid() const;
173 
176  Fw::SerialBufferBase& buffer,
178  ) const;
179 
182  Fw::SerialBufferBase& buffer,
184  );
185 
186 #if FW_SERIALIZABLE_TO_STRING
187 
189  void toString(
190  Fw::StringBase& sb
191  ) const;
192 
193 #endif
194 
195 #ifdef BUILD_UT
196 
198  void setSerializeValue(
199  SerialType serializeValue
200  );
201 
202 #endif
203 
204  public:
205 
206  // ----------------------------------------------------------------------
207  // Static functions
208  // ----------------------------------------------------------------------
209 
211  static bool isValid(
212  SerialType serialTypeValue
213  );
214 
215  public:
216 
217  // ----------------------------------------------------------------------
218  // Public member variables
219  // ----------------------------------------------------------------------
220 
222  enum T e;
223 
224  private:
225 
226  // ----------------------------------------------------------------------
227  // Private member variables
228  // ----------------------------------------------------------------------
229 
230 #ifdef BUILD_UT
231 
237  bool m_serializeValueIsSet = false;
238 
240  SerialType m_serializeValue = 0;
241 
242 #endif
243 
244  };
245 
246  }
247 
248 }
249 
250 #endif
enum T t
For backwards compatibility.
enum T e
The raw enum value.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
SerializeStatus
forward declaration for string
The size of the serial representation.
VersionEnum()
Constructor (default value of PROJECT_VERSION_00)
VersionEnum(const VersionEnum &obj)
Copy constructor.
The number of enumerated constants.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
bool operator!=(enum T e1) const
Inequality operator.
VersionEnum & operator=(const VersionEnum &obj)
Copy assignment operator (object)
bool operator==(enum T e1) const
Equality operator.
VersionEnum(const enum T e1)
Constructor (user-provided value)
U32 SerialType
The serial representation type.
bool isValid() const
Check raw enum value for validity.
RateGroupDivider component implementation.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
VersionEnum(const SerialType e1)
Constructor (serial representation value)