F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ClassEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ClassEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Class enum
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_Cfdp_ClassEnumAc_HPP
8 #define Svc_Ccsds_Cfdp_ClassEnumAc_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 Ccsds {
18 
19  namespace Cfdp {
20 
28  class Class :
29  public Fw::Serializable
30  {
31 
32  public:
33 
34  // ----------------------------------------------------------------------
35  // Types
36  // ----------------------------------------------------------------------
37 
39  using SerialType = U8;
40 
42  enum T {
44  CLASS_2 = 0,
46  CLASS_1 = 1,
47  };
48 
50  using t = enum T;
51 
52  public:
53 
54  // ----------------------------------------------------------------------
55  // Constants
56  // ----------------------------------------------------------------------
57 
58  enum {
63  };
64 
65  public:
66 
67  // ----------------------------------------------------------------------
68  // Constructors
69  // ----------------------------------------------------------------------
70 
73  {
74  this->e = CLASS_2;
75  }
76 
79  const enum T e1
80  )
81  {
82  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
83  this->e = e1;
84  }
85 
88  const Class& obj
89  )
90  {
91  this->e = obj.e;
92 #ifdef BUILD_UT
93  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
94  this->m_serializeValue = obj.m_serializeValue;
95 #endif
96  }
97 
98  public:
99 
100  // ----------------------------------------------------------------------
101  // Operators
102  // ----------------------------------------------------------------------
103 
105  Class& operator=(
106  const Class& obj
107  );
108 
110  Class& operator=(
111  enum T e1
112  );
113 
115  operator enum T() const
116  {
117  return this->e;
118  }
119 
121  bool operator==(enum T e1) const
122  {
123  return this->e == e1;
124  }
125 
127  bool operator!=(enum T e1) const
128  {
129  return !(*this == e1);
130  }
131 
132 #ifdef BUILD_UT
133 
135  friend std::ostream& operator<<(
136  std::ostream& os,
137  const Class& obj
138  );
139 
140 #endif
141 
142  public:
143 
144  // ----------------------------------------------------------------------
145  // Member functions
146  // ----------------------------------------------------------------------
147 
149  bool isValid() const;
150 
153  Fw::SerialBufferBase& buffer,
155  ) const;
156 
159  Fw::SerialBufferBase& buffer,
161  );
162 
163 #if FW_SERIALIZABLE_TO_STRING
164 
166  void toString(
167  Fw::StringBase& sb
168  ) const;
169 
170 #endif
171 
172 #ifdef BUILD_UT
173 
175  void setSerializeValue(
176  SerialType serializeValue
177  );
178 
179 #endif
180 
181  public:
182 
183  // ----------------------------------------------------------------------
184  // Static functions
185  // ----------------------------------------------------------------------
186 
188  static bool isValid(
189  SerialType serialTypeValue
190  );
191 
192  public:
193 
194  // ----------------------------------------------------------------------
195  // Public member variables
196  // ----------------------------------------------------------------------
197 
199  enum T e;
200 
201  private:
202 
203  // ----------------------------------------------------------------------
204  // Private member variables
205  // ----------------------------------------------------------------------
206 
207 #ifdef BUILD_UT
208 
214  bool m_serializeValueIsSet = false;
215 
217  SerialType m_serializeValue = 0;
218 
219 #endif
220 
221  };
222 
223  }
224 
225  }
226 
227 }
228 
229 #endif
U8 SerialType
The serial representation type.
Definition: ClassEnumAc.hpp:39
enum T e
The raw enum value.
CFDP class 2 - Reliable transfer (Acknowledged)
Definition: ClassEnumAc.hpp:44
CFDP class 1 - Unreliable transfer (Unacknowledged)
Definition: ClassEnumAc.hpp:46
bool operator!=(enum T e1) const
Inequality operator.
Class(const Class &obj)
Copy constructor.
Definition: ClassEnumAc.hpp:87
Class & operator=(const Class &obj)
Copy assignment operator (object)
Definition: ClassEnumAc.cpp:23
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: ClassEnumAc.cpp:85
Class(const enum T e1)
Constructor (user-provided value)
Definition: ClassEnumAc.hpp:78
bool operator==(enum T e1) const
Equality operator.
Class()
Constructor (default value of CLASS_2)
Definition: ClassEnumAc.hpp:72
The size of the serial representation.
Definition: ClassEnumAc.hpp:60
The number of enumerated constants.
Definition: ClassEnumAc.hpp:62
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: ClassEnumAc.cpp:67
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
RateGroupDivider component implementation.
bool isValid() const
Check raw enum value for validity.
Definition: ClassEnumAc.cpp:61
Endianness
T
The raw enum type.
Definition: ClassEnumAc.hpp:42
#define FW_ASSERT(...)
Definition: Assert.hpp:14
enum T t
For backwards compatibility.
Definition: ClassEnumAc.hpp:50
Big endian serialization.