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"
12 #include "Fw/Types/String.hpp"
13 
14 namespace ComCfg {
15 
17  class Pvn :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef U8 SerialType;
29 
31  enum T {
38  };
39 
41  typedef enum T t;
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
49  enum {
54  };
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Constructors
60  // ----------------------------------------------------------------------
61 
63  Pvn()
64  {
65  this->e = INVALID_UNINITIALIZED;
66  }
67 
69  Pvn(
70  const enum T e1
71  )
72  {
73  this->e = e1;
74  }
75 
77  Pvn(
78  const Pvn& obj
79  )
80  {
81  this->e = obj.e;
82  }
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Operators
88  // ----------------------------------------------------------------------
89 
91  Pvn& operator=(
92  const Pvn& obj
93  );
94 
96  Pvn& operator=(
97  enum T e1
98  );
99 
101  operator enum T() const
102  {
103  return this->e;
104  }
105 
107  bool operator==(enum T e1) const
108  {
109  return this->e == e1;
110  }
111 
113  bool operator!=(enum T e1) const
114  {
115  return !(*this == e1);
116  }
117 
118 #ifdef BUILD_UT
119 
121  friend std::ostream& operator<<(
122  std::ostream& os,
123  const Pvn& obj
124  );
125 
126 #endif
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Member functions
132  // ----------------------------------------------------------------------
133 
135  bool isValid() const;
136 
139  Fw::SerialBufferBase& buffer,
141  ) const;
142 
145  Fw::SerialBufferBase& buffer,
147  );
148 
149 #if FW_SERIALIZABLE_TO_STRING
150 
152  void toString(
153  Fw::StringBase& sb
154  ) const;
155 
156 #endif
157 
158  public:
159 
160  // ----------------------------------------------------------------------
161  // Member variables
162  // ----------------------------------------------------------------------
163 
165  enum T e;
166 
167  };
168 
169 }
170 
171 #endif
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: PvnEnumAc.cpp:69
Fully Featured CCSDS Space Packet Protocol.
Definition: PvnEnumAc.hpp:33
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: PvnEnumAc.cpp:56
Anything equal or higher value is invalid and should not be used.
Definition: PvnEnumAc.hpp:37
T
The raw enum type.
Definition: PvnEnumAc.hpp:31
bool isValid() const
Check raw enum value for validity.
Definition: PvnEnumAc.cpp:49
Pvn & operator=(const Pvn &obj)
Copy assignment operator (object)
Definition: PvnEnumAc.cpp:20
SerializeStatus
forward declaration for string
U8 SerialType
The serial representation type.
Definition: PvnEnumAc.hpp:28
The size of the serial representation.
Definition: PvnEnumAc.hpp:51
Pvn()
Constructor (default value of INVALID_UNINITIALIZED)
Definition: PvnEnumAc.hpp:63
Packet Version Numbers are 3 bits with only 2 currently valid values.
Definition: PvnEnumAc.hpp:17
bool operator==(enum T e1) const
Equality operator.
Definition: PvnEnumAc.hpp:107
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
Pvn(const enum T e1)
Constructor (user-provided value)
Definition: PvnEnumAc.hpp:69
enum T e
The raw enum value.
Definition: PvnEnumAc.hpp:165
Bare-bones CCSDS Encapsulation Packet Protocol.
Definition: PvnEnumAc.hpp:35
enum T t
For backwards compatibility.
Definition: PvnEnumAc.hpp:41
bool operator!=(enum T e1) const
Inequality operator.
Definition: PvnEnumAc.hpp:113
Endianness
Pvn(const Pvn &obj)
Copy constructor.
Definition: PvnEnumAc.hpp:77
Big endian serialization.
The number of enumerated constants.
Definition: PvnEnumAc.hpp:53