F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
MutexStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title MutexStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for MutexStatus enum
5 // ======================================================================
6 
7 #ifndef Os_MutexStatusEnumAc_HPP
8 #define Os_MutexStatusEnumAc_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 MutexStatus :
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,
43  };
44 
46  using t = enum 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 = OP_OK;
71  }
72 
75  const enum T e1
76  )
77  {
78  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
79  this->e = e1;
80  }
81 
84  const SerialType e1
85  )
86  {
87  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
88  this->e = static_cast<enum T>(e1);
89  }
90 
93  const MutexStatus& obj
94  )
95  {
96  this->e = obj.e;
97 #ifdef BUILD_UT
98  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
99  this->m_serializeValue = obj.m_serializeValue;
100 #endif
101  }
102 
103  public:
104 
105  // ----------------------------------------------------------------------
106  // Operators
107  // ----------------------------------------------------------------------
108 
111  const MutexStatus& obj
112  );
113 
116  SerialType e1
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 MutexStatus& 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
The number of enumerated constants.
Deadlock condition detected.
MutexStatus & operator=(const MutexStatus &obj)
Copy assignment operator (object)
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
U8 SerialType
The serial representation type.
enum T e
The raw enum value.
SerializeStatus
forward declaration for string
bool isValid() const
Check raw enum value for validity.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
enum T t
For backwards compatibility.
MutexStatus(const MutexStatus &obj)
Copy constructor.
Mutex feature is not supported.
The size of the serial representation.
MutexStatus()
Constructor (default value of OP_OK)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
bool operator==(enum T e1) const
Equality operator.
Operation was successful.
MutexStatus(const SerialType e1)
Constructor (serial representation value)
T
The raw enum type.
MutexStatus(const enum T e1)
Constructor (user-provided value)
bool operator!=(enum T e1) const
Inequality operator.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
FPP shadow-enum representing Os::Mutex::Status.