F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PvnEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PvnEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Pvn enum
5 // ======================================================================
6 
7 #ifndef ComCfg_PvnEnumAc_HPP
8 #define ComCfg_PvnEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace ComCfg {
16 
18  class Pvn :
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
39  };
40 
42  using t = enum T;
43 
44  public:
45 
46  // ----------------------------------------------------------------------
47  // Constants
48  // ----------------------------------------------------------------------
49 
50  enum {
55  };
56 
57  public:
58 
59  // ----------------------------------------------------------------------
60  // Constructors
61  // ----------------------------------------------------------------------
62 
64  Pvn()
65  {
66  this->e = INVALID_UNINITIALIZED;
67  }
68 
70  Pvn(
71  const enum T e1
72  )
73  {
74  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
75  this->e = e1;
76  }
77 
79  Pvn(
80  const SerialType e1
81  )
82  {
83  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
84  this->e = static_cast<enum T>(e1);
85  }
86 
88  Pvn(
89  const Pvn& obj
90  )
91  {
92  this->e = obj.e;
93 #ifdef BUILD_UT
94  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
95  this->m_serializeValue = obj.m_serializeValue;
96 #endif
97  }
98 
99  public:
100 
101  // ----------------------------------------------------------------------
102  // Operators
103  // ----------------------------------------------------------------------
104 
106  Pvn& operator=(
107  const Pvn& obj
108  );
109 
111  Pvn& operator=(
112  SerialType e1
113  );
114 
116  Pvn& operator=(
117  enum T e1
118  );
119 
121  operator enum T() const
122  {
123  return this->e;
124  }
125 
127  bool operator==(enum T e1) const
128  {
129  return this->e == e1;
130  }
131 
133  bool operator!=(enum T e1) const
134  {
135  return !(*this == e1);
136  }
137 
138 #ifdef BUILD_UT
139 
141  friend std::ostream& operator<<(
142  std::ostream& os,
143  const Pvn& obj
144  );
145 
146 #endif
147 
148  public:
149 
150  // ----------------------------------------------------------------------
151  // Member functions
152  // ----------------------------------------------------------------------
153 
155  bool isValid() const;
156 
159  Fw::SerialBufferBase& buffer,
161  ) const;
162 
165  Fw::SerialBufferBase& buffer,
167  );
168 
169 #if FW_SERIALIZABLE_TO_STRING
170 
172  void toString(
173  Fw::StringBase& sb
174  ) const;
175 
176 #endif
177 
178 #ifdef BUILD_UT
179 
181  void setSerializeValue(
182  SerialType serializeValue
183  );
184 
185 #endif
186 
187  public:
188 
189  // ----------------------------------------------------------------------
190  // Static functions
191  // ----------------------------------------------------------------------
192 
194  static bool isValid(
195  SerialType serialTypeValue
196  );
197 
198  public:
199 
200  // ----------------------------------------------------------------------
201  // Public member variables
202  // ----------------------------------------------------------------------
203 
205  enum T e;
206 
207  private:
208 
209  // ----------------------------------------------------------------------
210  // Private member variables
211  // ----------------------------------------------------------------------
212 
213 #ifdef BUILD_UT
214 
220  bool m_serializeValueIsSet = false;
221 
223  SerialType m_serializeValue = 0;
224 
225 #endif
226 
227  };
228 
229 }
230 
231 #endif
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: PvnEnumAc.cpp:93
Fully Featured CCSDS Space Packet Protocol.
Definition: PvnEnumAc.hpp:34
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: PvnEnumAc.cpp:75
The number of enumerated constants.
Definition: PvnEnumAc.hpp:54
Anything equal or higher value is invalid and should not be used.
Definition: PvnEnumAc.hpp:38
T
The raw enum type.
Definition: PvnEnumAc.hpp:32
bool isValid() const
Check raw enum value for validity.
Definition: PvnEnumAc.cpp:69
Pvn & operator=(const Pvn &obj)
Copy assignment operator (object)
Definition: PvnEnumAc.cpp:19
U8 SerialType
The serial representation type.
Definition: PvnEnumAc.hpp:29
SerializeStatus
forward declaration for string
The size of the serial representation.
Definition: PvnEnumAc.hpp:52
Pvn()
Constructor (default value of INVALID_UNINITIALIZED)
Definition: PvnEnumAc.hpp:64
enum T t
For backwards compatibility.
Definition: PvnEnumAc.hpp:42
Packet Version Numbers are 3 bits with only 2 currently valid values.
Definition: PvnEnumAc.hpp:18
bool operator==(enum T e1) const
Equality operator.
Definition: PvnEnumAc.hpp:127
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Pvn(const enum T e1)
Constructor (user-provided value)
Definition: PvnEnumAc.hpp:70
enum T e
The raw enum value.
Definition: PvnEnumAc.hpp:205
Bare-bones CCSDS Encapsulation Packet Protocol.
Definition: PvnEnumAc.hpp:36
Pvn(const SerialType e1)
Constructor (serial representation value)
Definition: PvnEnumAc.hpp:79
bool operator!=(enum T e1) const
Inequality operator.
Definition: PvnEnumAc.hpp:133
Endianness
Pvn(const Pvn &obj)
Copy constructor.
Definition: PvnEnumAc.hpp:88
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.