F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
I2cStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title I2cStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for I2cStatus enum
5 // ======================================================================
6 
7 #ifndef Drv_I2cStatusEnumAc_HPP
8 #define Drv_I2cStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Drv {
15 
16  class I2cStatus :
17  public Fw::Serializable
18  {
19 
20  public:
21 
22  // ----------------------------------------------------------------------
23  // Types
24  // ----------------------------------------------------------------------
25 
27  typedef U8 SerialType;
28 
30  enum T {
32  I2C_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 = I2C_OK;
71  }
72 
75  const T e1
76  )
77  {
78  this->e = e1;
79  }
80 
83  const I2cStatus& obj
84  )
85  {
86  this->e = obj.e;
87  }
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Operators
93  // ----------------------------------------------------------------------
94 
97  const I2cStatus& 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 I2cStatus& 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
T t
For backwards compatibility.
The number of enumerated constants.
T
The raw enum type.
SerializeStatus
forward declaration for string
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.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
I2cStatus & operator=(const I2cStatus &obj)
Copy assignment operator (object)
The size of the serial representation.
T e
The raw enum value.
U8 SerialType
The serial representation type.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
I2cStatus(const T e1)
Constructor (user-provided value)
bool operator!=(T e1) const
Inequality operator.
I2cStatus(const I2cStatus &obj)
Copy constructor.
Other errors that don&#39;t fit.
I2cStatus()
Constructor (default value of I2C_OK)
bool operator==(T e1) const
Equality operator.
Endianness
I2C driver failed to open device.
Transaction okay.
Big endian serialization.