F´ Flight Software - C/C++ Documentation  devel
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 "FpConfig.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 I32 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::SerializeBufferBase& buffer
145  ) const;
146 
149  Fw::SerializeBufferBase& buffer
150  );
151 
152 #if FW_SERIALIZABLE_TO_STRING
153 
155  void toString(
156  Fw::StringBase& sb
157  ) const;
158 
159 #endif
160 
161  public:
162 
163  // ----------------------------------------------------------------------
164  // Member variables
165  // ----------------------------------------------------------------------
166 
168  T e;
169 
170  };
171 
172 }
173 
174 #endif
C++-compatible configuration header for fprime configuration.
T
The raw enum type.
@ I2C_OPEN_ERR
I2C driver failed to open device.
@ I2C_OTHER_ERR
Other errors that don't fit.
@ I2C_WRITE_ERR
I2C write failed.
@ I2C_OK
Transaction okay.
@ I2C_ADDRESS_ERR
I2C address invalid.
@ I2C_READ_ERR
I2C read failed.
I2cStatus(const T e1)
Constructor (user-provided value)
I32 SerialType
The serial representation type.
I2cStatus()
Constructor (default value of I2C_OK)
I2cStatus(const I2cStatus &obj)
Copy constructor.
bool operator!=(T e1) const
Inequality operator.
@ NUM_CONSTANTS
The number of enumerated constants.
@ SERIALIZED_SIZE
The size of the serial representation.
T e
The raw enum value.
I2cStatus & operator=(const I2cStatus &obj)
Copy assignment operator (object)
bool operator==(T e1) const
Equality operator.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
T t
For backwards compatibility.
bool isValid() const
Check raw enum value for validity.
forward declaration
SerializeStatus
forward declaration for string