F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
GpioStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title GpioStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for GpioStatus enum
5 // ======================================================================
6 
7 #ifndef Drv_GpioStatusEnumAc_HPP
8 #define Drv_GpioStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Drv {
16 
17  class GpioStatus :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  using SerialType = U8;
29 
31  enum T {
33  OP_OK = 0,
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 = OP_OK;
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 GpioStatus& 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 GpioStatus& 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 GpioStatus& 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 operator!=(enum T e1) const
Inequality operator.
GpioStatus(const GpioStatus &obj)
Copy constructor.
GpioStatus(const SerialType e1)
Constructor (serial representation value)
The number of enumerated constants.
enum T t
For backwards compatibility.
Operation succeeded.
SerializeStatus
forward declaration for string
GpioStatus()
Constructor (default value of OP_OK)
An unknown error occurred.
bool operator==(enum T e1) const
Equality operator.
The size of the serial representation.
Operation not permitted with current configuration.
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
GpioStatus(const enum T e1)
Constructor (user-provided value)
enum T e
The raw enum value.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
U8 SerialType
The serial representation type.
Endianness
GpioStatus & operator=(const GpioStatus &obj)
Copy assignment operator (object)
T
The raw enum type.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
Pin was never opened.