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 VersionEnum& obj
98  )
99  {
100  this->e = obj.e;
101 #ifdef BUILD_UT
102  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
103  this->m_serializeValue = obj.m_serializeValue;
104 #endif
105  }
106 
107  public:
108 
109  // ----------------------------------------------------------------------
110  // Operators
111  // ----------------------------------------------------------------------
112 
115  const VersionEnum& obj
116  );
117 
120  enum T e1
121  );
122 
124  operator enum T() const
125  {
126  return this->e;
127  }
128 
130  bool operator==(enum T e1) const
131  {
132  return this->e == e1;
133  }
134 
136  bool operator!=(enum T e1) const
137  {
138  return !(*this == e1);
139  }
140 
141 #ifdef BUILD_UT
142 
144  friend std::ostream& operator<<(
145  std::ostream& os,
146  const VersionEnum& obj
147  );
148 
149 #endif
150 
151  public:
152 
153  // ----------------------------------------------------------------------
154  // Member functions
155  // ----------------------------------------------------------------------
156 
158  bool isValid() const;
159 
162  Fw::SerialBufferBase& buffer,
164  ) const;
165 
168  Fw::SerialBufferBase& buffer,
170  );
171 
172 #if FW_SERIALIZABLE_TO_STRING
173 
175  void toString(
176  Fw::StringBase& sb
177  ) const;
178 
179 #endif
180 
181 #ifdef BUILD_UT
182 
184  void setSerializeValue(
185  SerialType serializeValue
186  );
187 
188 #endif
189 
190  public:
191 
192  // ----------------------------------------------------------------------
193  // Static functions
194  // ----------------------------------------------------------------------
195 
197  static bool isValid(
198  SerialType serialTypeValue
199  );
200 
201  public:
202 
203  // ----------------------------------------------------------------------
204  // Public member variables
205  // ----------------------------------------------------------------------
206 
208  enum T e;
209 
210  private:
211 
212  // ----------------------------------------------------------------------
213  // Private member variables
214  // ----------------------------------------------------------------------
215 
216 #ifdef BUILD_UT
217 
223  bool m_serializeValueIsSet = false;
224 
226  SerialType m_serializeValue = 0;
227 
228 #endif
229 
230  };
231 
232  }
233 
234 }
235 
236 #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
VersionEnum()
Constructor (default value of PROJECT_VERSION_00)
VersionEnum(const VersionEnum &obj)
Copy constructor.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
The number of enumerated constants.
bool operator!=(enum T e1) const
Inequality operator.
The size of the serial representation.
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.