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 DpState& obj
82  )
83  {
84  this->e = obj.e;
85 #ifdef BUILD_UT
86  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
87  this->m_serializeValue = obj.m_serializeValue;
88 #endif
89  }
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Operators
95  // ----------------------------------------------------------------------
96 
99  const DpState& obj
100  );
101 
104  enum T e1
105  );
106 
108  operator enum T() const
109  {
110  return this->e;
111  }
112 
114  bool operator==(enum T e1) const
115  {
116  return this->e == e1;
117  }
118 
120  bool operator!=(enum T e1) const
121  {
122  return !(*this == e1);
123  }
124 
125 #ifdef BUILD_UT
126 
128  friend std::ostream& operator<<(
129  std::ostream& os,
130  const DpState& obj
131  );
132 
133 #endif
134 
135  public:
136 
137  // ----------------------------------------------------------------------
138  // Member functions
139  // ----------------------------------------------------------------------
140 
142  bool isValid() const;
143 
146  Fw::SerialBufferBase& buffer,
148  ) const;
149 
152  Fw::SerialBufferBase& buffer,
154  );
155 
156 #if FW_SERIALIZABLE_TO_STRING
157 
159  void toString(
160  Fw::StringBase& sb
161  ) const;
162 
163 #endif
164 
165 #ifdef BUILD_UT
166 
168  void setSerializeValue(
169  SerialType serializeValue
170  );
171 
172 #endif
173 
174  public:
175 
176  // ----------------------------------------------------------------------
177  // Static functions
178  // ----------------------------------------------------------------------
179 
181  static bool isValid(
182  SerialType serialTypeValue
183  );
184 
185  public:
186 
187  // ----------------------------------------------------------------------
188  // Public member variables
189  // ----------------------------------------------------------------------
190 
192  enum T e;
193 
194  private:
195 
196  // ----------------------------------------------------------------------
197  // Private member variables
198  // ----------------------------------------------------------------------
199 
200 #ifdef BUILD_UT
201 
207  bool m_serializeValueIsSet = false;
208 
210  SerialType m_serializeValue = 0;
211 
212 #endif
213 
214  };
215 
216 }
217 
218 #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 size of the serial representation.
The untransmitted state.
U8 SerialType
The serial representation type.
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.