F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SpiStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpiStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SpiStatus enum
5 // ======================================================================
6 
7 #ifndef Drv_SpiStatusEnumAc_HPP
8 #define Drv_SpiStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Drv {
15 
16  class SpiStatus :
17  public Fw::Serializable
18  {
19 
20  public:
21 
22  // ----------------------------------------------------------------------
23  // Types
24  // ----------------------------------------------------------------------
25 
27  typedef U8 SerialType;
28 
30  enum T {
32  SPI_OK = 0,
43  };
44 
46  typedef T t;
47 
48  public:
49 
50  // ----------------------------------------------------------------------
51  // Constants
52  // ----------------------------------------------------------------------
53 
54  enum {
59  };
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Constructors
65  // ----------------------------------------------------------------------
66 
69  {
70  this->e = SPI_OK;
71  }
72 
75  const T e1
76  )
77  {
78  this->e = e1;
79  }
80 
83  const SpiStatus& obj
84  )
85  {
86  this->e = obj.e;
87  }
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Operators
93  // ----------------------------------------------------------------------
94 
97  const SpiStatus& obj
98  );
99 
102  T e1
103  );
104 
106  operator T() const
107  {
108  return this->e;
109  }
110 
112  bool operator==(T e1) const
113  {
114  return this->e == e1;
115  }
116 
118  bool operator!=(T e1) const
119  {
120  return !(*this == e1);
121  }
122 
123 #ifdef BUILD_UT
124 
126  friend std::ostream& operator<<(
127  std::ostream& os,
128  const SpiStatus& obj
129  );
130 
131 #endif
132 
133  public:
134 
135  // ----------------------------------------------------------------------
136  // Member functions
137  // ----------------------------------------------------------------------
138 
140  bool isValid() const;
141 
144  Fw::SerialBufferBase& buffer,
146  ) const;
147 
150  Fw::SerialBufferBase& buffer,
152  );
153 
154 #if FW_SERIALIZABLE_TO_STRING
155 
157  void toString(
158  Fw::StringBase& sb
159  ) const;
160 
161 #endif
162 
163  public:
164 
165  // ----------------------------------------------------------------------
166  // Member variables
167  // ----------------------------------------------------------------------
168 
170  T e;
171 
172  };
173 
174 }
175 
176 #endif
SpiStatus(const SpiStatus &obj)
Copy constructor.
U8 SerialType
The serial representation type.
bool operator!=(T e1) const
Inequality operator.
SerializeStatus
forward declaration for string
The size of the serial representation.
Other errors that do not fit.
The number of enumerated constants.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
SpiStatus()
Constructor (default value of SPI_OK)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
T t
For backwards compatibility.
SpiStatus & operator=(const SpiStatus &obj)
Copy assignment operator (object)
SPI driver failed to open device.
T
The raw enum type.
Endianness
SpiStatus(const T e1)
Constructor (user-provided value)
Transaction okay.
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.
Big endian serialization.
bool operator==(T e1) const
Equality operator.
T e
The raw enum value.