F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpStateEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpStateEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpState enum
5 // ======================================================================
6 
7 #ifndef Fw_DpStateEnumAc_HPP
8 #define Fw_DpStateEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Fw {
16 
17  class DpState :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  using SerialType = U8;
29 
31  enum T {
37  PARTIAL = 1,
40  };
41 
43  using t = enum T;
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
51  enum {
56  };
57 
58  public:
59 
60  // ----------------------------------------------------------------------
61  // Constructors
62  // ----------------------------------------------------------------------
63 
66  {
67  this->e = UNTRANSMITTED;
68  }
69 
72  const enum T e1
73  )
74  {
75  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
76  this->e = e1;
77  }
78 
81  const SerialType e1
82  )
83  {
84  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
85  this->e = static_cast<enum T>(e1);
86  }
87 
90  const DpState& obj
91  )
92  {
93  this->e = obj.e;
94 #ifdef BUILD_UT
95  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
96  this->m_serializeValue = obj.m_serializeValue;
97 #endif
98  }
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Operators
104  // ----------------------------------------------------------------------
105 
108  const DpState& obj
109  );
110 
113  SerialType e1
114  );
115 
118  enum T e1
119  );
120 
122  operator enum T() const
123  {
124  return this->e;
125  }
126 
128  bool operator==(enum T e1) const
129  {
130  return this->e == e1;
131  }
132 
134  bool operator!=(enum T e1) const
135  {
136  return !(*this == e1);
137  }
138 
139 #ifdef BUILD_UT
140 
142  friend std::ostream& operator<<(
143  std::ostream& os,
144  const DpState& obj
145  );
146 
147 #endif
148 
149  public:
150 
151  // ----------------------------------------------------------------------
152  // Member functions
153  // ----------------------------------------------------------------------
154 
156  bool isValid() const;
157 
160  Fw::SerialBufferBase& buffer,
162  ) const;
163 
166  Fw::SerialBufferBase& buffer,
168  );
169 
170 #if FW_SERIALIZABLE_TO_STRING
171 
173  void toString(
174  Fw::StringBase& sb
175  ) const;
176 
177 #endif
178 
179 #ifdef BUILD_UT
180 
182  void setSerializeValue(
183  SerialType serializeValue
184  );
185 
186 #endif
187 
188  public:
189 
190  // ----------------------------------------------------------------------
191  // Static functions
192  // ----------------------------------------------------------------------
193 
195  static bool isValid(
196  SerialType serialTypeValue
197  );
198 
199  public:
200 
201  // ----------------------------------------------------------------------
202  // Public member variables
203  // ----------------------------------------------------------------------
204 
206  enum T e;
207 
208  private:
209 
210  // ----------------------------------------------------------------------
211  // Private member variables
212  // ----------------------------------------------------------------------
213 
214 #ifdef BUILD_UT
215 
221  bool m_serializeValueIsSet = false;
222 
224  SerialType m_serializeValue = 0;
225 
226 #endif
227 
228  };
229 
230 }
231 
232 #endif
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
DpState & operator=(const DpState &obj)
Copy assignment operator (object)
T
The raw enum type.
DpState(const enum T e1)
Constructor (user-provided value)
DpState(const DpState &obj)
Copy constructor.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
The transmitted state.
The number of enumerated constants.
The untransmitted state.
U8 SerialType
The serial representation type.
The size of the serial representation.
DpState(const SerialType e1)
Constructor (serial representation value)
enum T e
The raw enum value.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
enum T t
For backwards compatibility.
bool operator==(enum T e1) const
Equality operator.
DpState()
Constructor (default value of UNTRANSMITTED)
Implementation of malloc based allocator.
Endianness
bool operator!=(enum T e1) const
Inequality operator.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.