F´ Flight Software - C/C++ Documentation  devel
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 "FpConfig.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Drv {
15 
16  class GpioStatus :
17  public Fw::Serializable
18  {
19 
20  public:
21 
22  // ----------------------------------------------------------------------
23  // Types
24  // ----------------------------------------------------------------------
25 
27  typedef I32 SerialType;
28 
30  enum T {
32  OP_OK = 0,
39  };
40 
42  typedef T t;
43 
44  public:
45 
46  // ----------------------------------------------------------------------
47  // Constants
48  // ----------------------------------------------------------------------
49 
50  enum {
55  };
56 
57  public:
58 
59  // ----------------------------------------------------------------------
60  // Constructors
61  // ----------------------------------------------------------------------
62 
65  {
66  this->e = OP_OK;
67  }
68 
71  const T e1
72  )
73  {
74  this->e = e1;
75  }
76 
79  const GpioStatus& obj
80  )
81  {
82  this->e = obj.e;
83  }
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Operators
89  // ----------------------------------------------------------------------
90 
93  const GpioStatus& obj
94  );
95 
98  T e1
99  );
100 
102  operator T() const
103  {
104  return this->e;
105  }
106 
108  bool operator==(T e1) const
109  {
110  return this->e == e1;
111  }
112 
114  bool operator!=(T e1) const
115  {
116  return !(*this == e1);
117  }
118 
119 #ifdef BUILD_UT
120 
122  friend std::ostream& operator<<(
123  std::ostream& os,
124  const GpioStatus& obj
125  );
126 
127 #endif
128 
129  public:
130 
131  // ----------------------------------------------------------------------
132  // Member functions
133  // ----------------------------------------------------------------------
134 
136  bool isValid() const;
137 
140  Fw::SerializeBufferBase& buffer
141  ) const;
142 
145  Fw::SerializeBufferBase& buffer
146  );
147 
148 #if FW_SERIALIZABLE_TO_STRING
149 
151  void toString(
152  Fw::StringBase& sb
153  ) const;
154 
155 #endif
156 
157  public:
158 
159  // ----------------------------------------------------------------------
160  // Member variables
161  // ----------------------------------------------------------------------
162 
164  T e;
165 
166  };
167 
168 }
169 
170 #endif
C++-compatible configuration header for fprime configuration.
GpioStatus & operator=(const GpioStatus &obj)
Copy assignment operator (object)
GpioStatus(const T e1)
Constructor (user-provided value)
T
The raw enum type.
@ INVALID_MODE
Operation not permitted with current configuration.
@ NOT_OPENED
Pin was never opened.
@ UNKNOWN_ERROR
An unknown error occurred.
@ OP_OK
Operation succeeded.
I32 SerialType
The serial representation type.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
GpioStatus()
Constructor (default value of OP_OK)
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
@ SERIALIZED_SIZE
The size of the serial representation.
@ NUM_CONSTANTS
The number of enumerated constants.
GpioStatus(const GpioStatus &obj)
Copy constructor.
bool operator!=(T e1) const
Inequality operator.
T e
The raw enum value.
bool operator==(T e1) const
Equality operator.
T t
For backwards compatibility.
forward declaration
SerializeStatus
forward declaration for string