F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
PollStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PollStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for PollStatus enum
5 // ======================================================================
6 
7 #ifndef Drv_PollStatusEnumAc_HPP
8 #define Drv_PollStatusEnumAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Drv {
15 
16  class PollStatus :
17  public Fw::Serializable
18  {
19 
20  public:
21 
22  // ----------------------------------------------------------------------
23  // Types
24  // ----------------------------------------------------------------------
25 
27  typedef I32 SerialType;
28 
30  enum T {
32  POLL_OK = 0,
37  };
38 
40  typedef T t;
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
48  enum {
53  };
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Constructors
59  // ----------------------------------------------------------------------
60 
63  {
64  this->e = POLL_OK;
65  }
66 
69  const T e1
70  )
71  {
72  this->e = e1;
73  }
74 
77  const PollStatus& obj
78  )
79  {
80  this->e = obj.e;
81  }
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Operators
87  // ----------------------------------------------------------------------
88 
91  const PollStatus& obj
92  );
93 
96  T e1
97  );
98 
100  operator T() const
101  {
102  return this->e;
103  }
104 
106  bool operator==(T e1) const
107  {
108  return this->e == e1;
109  }
110 
112  bool operator!=(T e1) const
113  {
114  return !(*this == e1);
115  }
116 
117 #ifdef BUILD_UT
118 
120  friend std::ostream& operator<<(
121  std::ostream& os,
122  const PollStatus& obj
123  );
124 
125 #endif
126 
127  public:
128 
129  // ----------------------------------------------------------------------
130  // Member functions
131  // ----------------------------------------------------------------------
132 
134  bool isValid() const;
135 
138  Fw::SerializeBufferBase& buffer
139  ) const;
140 
143  Fw::SerializeBufferBase& buffer
144  );
145 
146 #if FW_SERIALIZABLE_TO_STRING
147 
149  void toString(
150  Fw::StringBase& sb
151  ) const;
152 
153 #endif
154 
155  public:
156 
157  // ----------------------------------------------------------------------
158  // Member variables
159  // ----------------------------------------------------------------------
160 
162  T e;
163 
164  };
165 
166 }
167 
168 #endif
C++-compatible configuration header for fprime configuration.
PollStatus()
Constructor (default value of POLL_OK)
T t
For backwards compatibility.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
T e
The raw enum value.
T
The raw enum type.
@ POLL_OK
Poll successfully received data.
@ POLL_ERROR
Error received when polling.
@ POLL_RETRY
No data available, retry later.
PollStatus(const T e1)
Constructor (user-provided value)
PollStatus(const PollStatus &obj)
Copy constructor.
I32 SerialType
The serial representation type.
PollStatus & operator=(const PollStatus &obj)
Copy assignment operator (object)
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
bool operator==(T e1) const
Equality operator.
@ NUM_CONSTANTS
The number of enumerated constants.
@ SERIALIZED_SIZE
The size of the serial representation.
bool operator!=(T e1) const
Inequality operator.
forward declaration
SerializeStatus
forward declaration for string