F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
14namespace Drv {
15
16 class I2cStatus :
17 public Fw::Serializable
18 {
19
20 public:
21
22 // ----------------------------------------------------------------------
23 // Types
24 // ----------------------------------------------------------------------
25
27 typedef I32 SerialType;
28
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 e
76 )
77 {
78 this->e = e;
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 e
103 );
104
106 operator T() const
107 {
108 return this->e;
109 }
110
112 bool operator==(T e) const
113 {
114 return this->e == e;
115 }
116
118 bool operator!=(T e) const
119 {
120 return !(*this == e);
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
145 ) const;
146
150 );
151
152#if FW_SERIALIZABLE_TO_STRING || FW_ENABLE_TEXT_LOGGING || BUILD_UT
153
155 void toString(
156 Fw::StringBase& sb
157 ) const;
158
159#endif
160
161 public:
162
163 // ----------------------------------------------------------------------
164 // Member variables
165 // ----------------------------------------------------------------------
166
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 e)
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 e) const
Equality 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)
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 operator!=(T e) const
Inequality operator.
bool isValid() const
Check raw enum value for validity.
forward declaration
SerializeStatus
forward declaration for string