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 Pvn& obj
81  )
82  {
83  this->e = obj.e;
84 #ifdef BUILD_UT
85  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
86  this->m_serializeValue = obj.m_serializeValue;
87 #endif
88  }
89 
90  public:
91 
92  // ----------------------------------------------------------------------
93  // Operators
94  // ----------------------------------------------------------------------
95 
97  Pvn& operator=(
98  const Pvn& obj
99  );
100 
102  Pvn& operator=(
103  enum T e1
104  );
105 
107  operator enum T() const
108  {
109  return this->e;
110  }
111 
113  bool operator==(enum T e1) const
114  {
115  return this->e == e1;
116  }
117 
119  bool operator!=(enum T e1) const
120  {
121  return !(*this == e1);
122  }
123 
124 #ifdef BUILD_UT
125 
127  friend std::ostream& operator<<(
128  std::ostream& os,
129  const Pvn& obj
130  );
131 
132 #endif
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Member functions
138  // ----------------------------------------------------------------------
139 
141  bool isValid() const;
142 
145  Fw::SerialBufferBase& buffer,
147  ) const;
148 
151  Fw::SerialBufferBase& buffer,
153  );
154 
155 #if FW_SERIALIZABLE_TO_STRING
156 
158  void toString(
159  Fw::StringBase& sb
160  ) const;
161 
162 #endif
163 
164 #ifdef BUILD_UT
165 
167  void setSerializeValue(
168  SerialType serializeValue
169  );
170 
171 #endif
172 
173  public:
174 
175  // ----------------------------------------------------------------------
176  // Static functions
177  // ----------------------------------------------------------------------
178 
180  static bool isValid(
181  SerialType serialTypeValue
182  );
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Public member variables
188  // ----------------------------------------------------------------------
189 
191  enum T e;
192 
193  private:
194 
195  // ----------------------------------------------------------------------
196  // Private member variables
197  // ----------------------------------------------------------------------
198 
199 #ifdef BUILD_UT
200 
206  bool m_serializeValueIsSet = false;
207 
209  SerialType m_serializeValue = 0;
210 
211 #endif
212 
213  };
214 
215 }
216 
217 #endif
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: PvnEnumAc.cpp:81
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:63
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:57
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 number of enumerated constants.
Definition: PvnEnumAc.hpp:54
Pvn()
Constructor (default value of INVALID_UNINITIALIZED)
Definition: PvnEnumAc.hpp:64
The size of the serial representation.
Definition: PvnEnumAc.hpp:52
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:113
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:191
Bare-bones CCSDS Encapsulation Packet Protocol.
Definition: PvnEnumAc.hpp:36
bool operator!=(enum T e1) const
Inequality operator.
Definition: PvnEnumAc.hpp:119
Endianness
Pvn(const Pvn &obj)
Copy constructor.
Definition: PvnEnumAc.hpp:79
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.