F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TfvnEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TfvnEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Tfvn enum
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_TfvnEnumAc_HPP
8 #define Svc_Ccsds_TfvnEnumAc_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 
28  class Tfvn :
29  public Fw::Serializable
30  {
31 
32  public:
33 
34  // ----------------------------------------------------------------------
35  // Types
36  // ----------------------------------------------------------------------
37 
39  using SerialType = U8;
40 
42  enum T {
44  TM_TC = 0,
46  AOS = 1,
48  PROX_ONE = 2,
50  USLP = 3,
53  };
54 
56  using t = enum T;
57 
58  public:
59 
60  // ----------------------------------------------------------------------
61  // Constants
62  // ----------------------------------------------------------------------
63 
64  enum {
69  };
70 
71  public:
72 
73  // ----------------------------------------------------------------------
74  // Constructors
75  // ----------------------------------------------------------------------
76 
78  Tfvn()
79  {
80  this->e = INVALID_UNINITIALIZED;
81  }
82 
85  const enum T e1
86  )
87  {
88  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
89  this->e = e1;
90  }
91 
94  const SerialType e1
95  )
96  {
97  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
98  this->e = static_cast<enum T>(e1);
99  }
100 
103  const Tfvn& obj
104  )
105  {
106  this->e = obj.e;
107 #ifdef BUILD_UT
108  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
109  this->m_serializeValue = obj.m_serializeValue;
110 #endif
111  }
112 
113  public:
114 
115  // ----------------------------------------------------------------------
116  // Operators
117  // ----------------------------------------------------------------------
118 
120  Tfvn& operator=(
121  const Tfvn& obj
122  );
123 
125  Tfvn& operator=(
126  SerialType e1
127  );
128 
130  Tfvn& operator=(
131  enum T e1
132  );
133 
135  operator enum T() const
136  {
137  return this->e;
138  }
139 
141  bool operator==(enum T e1) const
142  {
143  return this->e == e1;
144  }
145 
147  bool operator!=(enum T e1) const
148  {
149  return !(*this == e1);
150  }
151 
152 #ifdef BUILD_UT
153 
155  friend std::ostream& operator<<(
156  std::ostream& os,
157  const Tfvn& obj
158  );
159 
160 #endif
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Member functions
166  // ----------------------------------------------------------------------
167 
169  bool isValid() const;
170 
173  Fw::SerialBufferBase& buffer,
175  ) const;
176 
179  Fw::SerialBufferBase& buffer,
181  );
182 
183 #if FW_SERIALIZABLE_TO_STRING
184 
186  void toString(
187  Fw::StringBase& sb
188  ) const;
189 
190 #endif
191 
192 #ifdef BUILD_UT
193 
195  void setSerializeValue(
196  SerialType serializeValue
197  );
198 
199 #endif
200 
201  public:
202 
203  // ----------------------------------------------------------------------
204  // Static functions
205  // ----------------------------------------------------------------------
206 
208  static bool isValid(
209  SerialType serialTypeValue
210  );
211 
212  public:
213 
214  // ----------------------------------------------------------------------
215  // Public member variables
216  // ----------------------------------------------------------------------
217 
219  enum T e;
220 
221  private:
222 
223  // ----------------------------------------------------------------------
224  // Private member variables
225  // ----------------------------------------------------------------------
226 
227 #ifdef BUILD_UT
228 
234  bool m_serializeValueIsSet = false;
235 
237  SerialType m_serializeValue = 0;
238 
239 #endif
240 
241  };
242 
243  }
244 
245 }
246 
247 #endif
Advanced Orbiting Systems SDL.
Definition: TfvnEnumAc.hpp:46
enum T t
For backwards compatibility.
Definition: TfvnEnumAc.hpp:56
The number of enumerated constants.
Definition: TfvnEnumAc.hpp:68
Proximity-1 SDL.
Definition: TfvnEnumAc.hpp:48
The size of the serial representation.
Definition: TfvnEnumAc.hpp:66
SerializeStatus
forward declaration for string
bool isValid() const
Check raw enum value for validity.
Definition: TfvnEnumAc.cpp:71
enum T e
The raw enum value.
Definition: TfvnEnumAc.hpp:219
Telemetry and Telecommand SDLs.
Definition: TfvnEnumAc.hpp:44
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: TfvnEnumAc.cpp:77
Tfvn(const SerialType e1)
Constructor (serial representation value)
Definition: TfvnEnumAc.hpp:93
Tfvn()
Constructor (default value of INVALID_UNINITIALIZED)
Definition: TfvnEnumAc.hpp:78
Tfvn & operator=(const Tfvn &obj)
Copy assignment operator (object)
Definition: TfvnEnumAc.cpp:21
bool operator!=(enum T e1) const
Inequality operator.
Definition: TfvnEnumAc.hpp:147
Tfvn(const Tfvn &obj)
Copy constructor.
Definition: TfvnEnumAc.hpp:102
RateGroupDivider component implementation.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: TfvnEnumAc.cpp:95
U8 SerialType
The serial representation type.
Definition: TfvnEnumAc.hpp:39
bool operator==(enum T e1) const
Equality operator.
Definition: TfvnEnumAc.hpp:141
Endianness
Tfvn(const enum T e1)
Constructor (user-provided value)
Definition: TfvnEnumAc.hpp:84
Unified Space Data Link Protocol.
Definition: TfvnEnumAc.hpp:50
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Anything equal or higher value is invalid and should not be used.
Definition: TfvnEnumAc.hpp:52
T
The raw enum type.
Definition: TfvnEnumAc.hpp:42
Big endian serialization.