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 QueueStatus& obj
99  )
100  {
101  this->e = obj.e;
102 #ifdef BUILD_UT
103  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
104  this->m_serializeValue = obj.m_serializeValue;
105 #endif
106  }
107 
108  public:
109 
110  // ----------------------------------------------------------------------
111  // Operators
112  // ----------------------------------------------------------------------
113 
116  const QueueStatus& obj
117  );
118 
121  enum T e1
122  );
123 
125  operator enum T() const
126  {
127  return this->e;
128  }
129 
131  bool operator==(enum T e1) const
132  {
133  return this->e == e1;
134  }
135 
137  bool operator!=(enum T e1) const
138  {
139  return !(*this == e1);
140  }
141 
142 #ifdef BUILD_UT
143 
145  friend std::ostream& operator<<(
146  std::ostream& os,
147  const QueueStatus& obj
148  );
149 
150 #endif
151 
152  public:
153 
154  // ----------------------------------------------------------------------
155  // Member functions
156  // ----------------------------------------------------------------------
157 
159  bool isValid() const;
160 
163  Fw::SerialBufferBase& buffer,
165  ) const;
166 
169  Fw::SerialBufferBase& buffer,
171  );
172 
173 #if FW_SERIALIZABLE_TO_STRING
174 
176  void toString(
177  Fw::StringBase& sb
178  ) const;
179 
180 #endif
181 
182 #ifdef BUILD_UT
183 
185  void setSerializeValue(
186  SerialType serializeValue
187  );
188 
189 #endif
190 
191  public:
192 
193  // ----------------------------------------------------------------------
194  // Static functions
195  // ----------------------------------------------------------------------
196 
198  static bool isValid(
199  SerialType serialTypeValue
200  );
201 
202  public:
203 
204  // ----------------------------------------------------------------------
205  // Public member variables
206  // ----------------------------------------------------------------------
207 
209  enum T e;
210 
211  private:
212 
213  // ----------------------------------------------------------------------
214  // Private member variables
215  // ----------------------------------------------------------------------
216 
217 #ifdef BUILD_UT
218 
224  bool m_serializeValueIsSet = false;
225 
227  SerialType m_serializeValue = 0;
228 
229 #endif
230 
231  };
232 
233 }
234 
235 #endif
invalid priority requested
bool isValid() const
Check raw enum value for validity.
QueueStatus & operator=(const QueueStatus &obj)
Copy assignment operator (object)
The number of enumerated constants.
message sent/received okay
SerializeStatus
forward declaration for string
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.
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.
The size of the serial representation.
bool operator==(enum T e1) const
Equality operator.
Unexpected error; can&#39;t match with returns.