F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
VersionEnabledEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title VersionEnabledEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for VersionEnabled enum
5 // ======================================================================
6 
7 #ifndef Svc_VersionEnabledEnumAc_HPP
8 #define Svc_VersionEnabledEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
34  DISABLED = 0,
36  ENABLED = 1,
37  };
38 
40  using t = enum T;
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
48  enum {
53  };
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Constructors
59  // ----------------------------------------------------------------------
60 
63  {
64  this->e = DISABLED;
65  }
66 
69  const enum T e1
70  )
71  {
72  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
73  this->e = e1;
74  }
75 
78  const SerialType e1
79  )
80  {
81  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
82  this->e = static_cast<enum T>(e1);
83  }
84 
87  const VersionEnabled& obj
88  )
89  {
90  this->e = obj.e;
91 #ifdef BUILD_UT
92  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
93  this->m_serializeValue = obj.m_serializeValue;
94 #endif
95  }
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Operators
101  // ----------------------------------------------------------------------
102 
105  const VersionEnabled& obj
106  );
107 
110  SerialType e1
111  );
112 
115  enum T e1
116  );
117 
119  operator enum T() const
120  {
121  return this->e;
122  }
123 
125  bool operator==(enum T e1) const
126  {
127  return this->e == e1;
128  }
129 
131  bool operator!=(enum T e1) const
132  {
133  return !(*this == e1);
134  }
135 
136 #ifdef BUILD_UT
137 
139  friend std::ostream& operator<<(
140  std::ostream& os,
141  const VersionEnabled& obj
142  );
143 
144 #endif
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Member functions
150  // ----------------------------------------------------------------------
151 
153  bool isValid() const;
154 
157  Fw::SerialBufferBase& buffer,
159  ) const;
160 
163  Fw::SerialBufferBase& buffer,
165  );
166 
167 #if FW_SERIALIZABLE_TO_STRING
168 
170  void toString(
171  Fw::StringBase& sb
172  ) const;
173 
174 #endif
175 
176 #ifdef BUILD_UT
177 
179  void setSerializeValue(
180  SerialType serializeValue
181  );
182 
183 #endif
184 
185  public:
186 
187  // ----------------------------------------------------------------------
188  // Static functions
189  // ----------------------------------------------------------------------
190 
192  static bool isValid(
193  SerialType serialTypeValue
194  );
195 
196  public:
197 
198  // ----------------------------------------------------------------------
199  // Public member variables
200  // ----------------------------------------------------------------------
201 
203  enum T e;
204 
205  private:
206 
207  // ----------------------------------------------------------------------
208  // Private member variables
209  // ----------------------------------------------------------------------
210 
211 #ifdef BUILD_UT
212 
218  bool m_serializeValueIsSet = false;
219 
221  SerialType m_serializeValue = 0;
222 
223 #endif
224 
225  };
226 
227 }
228 
229 #endif
enum T e
The raw enum value.
VersionEnabled(const enum T e1)
Constructor (user-provided value)
VersionEnabled()
Constructor (default value of DISABLED)
bool operator!=(enum T e1) const
Inequality operator.
U8 SerialType
The serial representation type.
SerializeStatus
forward declaration for string
The size of the serial representation.
bool isValid() const
Check raw enum value for validity.
VersionEnabled(const VersionEnabled &obj)
Copy constructor.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
VersionEnabled & operator=(const VersionEnabled &obj)
Copy assignment operator (object)
VersionEnabled(const SerialType e1)
Constructor (serial representation value)
enum T t
For backwards compatibility.
bool operator==(enum T e1) const
Equality operator.
RateGroupDivider component implementation.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Endianness
Tracks versions for project, framework and user defined versions etc.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Big endian serialization.
The number of enumerated constants.