F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
QueueStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title QueueStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for QueueStatus enum
5 // ======================================================================
6 
7 #ifndef Os_QueueStatusEnumAc_HPP
8 #define Os_QueueStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Os {
16 
18  class QueueStatus :
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
34  OP_OK = 0,
38  EMPTY = 2,
50  FULL = 8,
57  };
58 
60  using t = enum T;
61 
62  public:
63 
64  // ----------------------------------------------------------------------
65  // Constants
66  // ----------------------------------------------------------------------
67 
68  enum {
73  };
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Constructors
79  // ----------------------------------------------------------------------
80 
83  {
84  this->e = OP_OK;
85  }
86 
89  const enum T e1
90  )
91  {
92  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
93  this->e = e1;
94  }
95 
98  const SerialType e1
99  )
100  {
101  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
102  this->e = static_cast<enum T>(e1);
103  }
104 
107  const QueueStatus& obj
108  )
109  {
110  this->e = obj.e;
111 #ifdef BUILD_UT
112  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
113  this->m_serializeValue = obj.m_serializeValue;
114 #endif
115  }
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Operators
121  // ----------------------------------------------------------------------
122 
125  const QueueStatus& obj
126  );
127 
130  SerialType e1
131  );
132 
135  enum T e1
136  );
137 
139  operator enum T() const
140  {
141  return this->e;
142  }
143 
145  bool operator==(enum T e1) const
146  {
147  return this->e == e1;
148  }
149 
151  bool operator!=(enum T e1) const
152  {
153  return !(*this == e1);
154  }
155 
156 #ifdef BUILD_UT
157 
159  friend std::ostream& operator<<(
160  std::ostream& os,
161  const QueueStatus& obj
162  );
163 
164 #endif
165 
166  public:
167 
168  // ----------------------------------------------------------------------
169  // Member functions
170  // ----------------------------------------------------------------------
171 
173  bool isValid() const;
174 
177  Fw::SerialBufferBase& buffer,
179  ) const;
180 
183  Fw::SerialBufferBase& buffer,
185  );
186 
187 #if FW_SERIALIZABLE_TO_STRING
188 
190  void toString(
191  Fw::StringBase& sb
192  ) const;
193 
194 #endif
195 
196 #ifdef BUILD_UT
197 
199  void setSerializeValue(
200  SerialType serializeValue
201  );
202 
203 #endif
204 
205  public:
206 
207  // ----------------------------------------------------------------------
208  // Static functions
209  // ----------------------------------------------------------------------
210 
212  static bool isValid(
213  SerialType serialTypeValue
214  );
215 
216  public:
217 
218  // ----------------------------------------------------------------------
219  // Public member variables
220  // ----------------------------------------------------------------------
221 
223  enum T e;
224 
225  private:
226 
227  // ----------------------------------------------------------------------
228  // Private member variables
229  // ----------------------------------------------------------------------
230 
231 #ifdef BUILD_UT
232 
238  bool m_serializeValueIsSet = false;
239 
241  SerialType m_serializeValue = 0;
242 
243 #endif
244 
245  };
246 
247 }
248 
249 #endif
invalid priority requested
bool isValid() const
Check raw enum value for validity.
QueueStatus & operator=(const QueueStatus &obj)
Copy assignment operator (object)
The size of the serial representation.
message sent/received okay
SerializeStatus
forward declaration for string
The number of enumerated constants.
QueueStatus()
Constructor (default value of OP_OK)
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Queue was full when attempting to send a message.
QueueStatus(const SerialType e1)
Constructor (serial representation value)
enum T t
For backwards compatibility.
attempted to send or receive with buffer too large, too small
T
The raw enum type.
QueueStatus(const QueueStatus &obj)
Copy constructor.
Queue feature is not supported.
FPP shadow-enum representing Os::Queue::Status.
enum T e
The raw enum value.
bool operator!=(enum T e1) const
Inequality operator.
creating an already created queue
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
QueueStatus(const enum T e1)
Constructor (user-provided value)
U8 SerialType
The serial representation type.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
If non-blocking, all the messages have been drained.
required memory could not be allocated
Queue wasn&#39;t initialized successfully.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
bool operator==(enum T e1) const
Equality operator.
Unexpected error; can&#39;t match with returns.