F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileStatus enum
5 // ======================================================================
6 
7 #ifndef Os_FileStatusEnumAc_HPP
8 #define Os_FileStatusEnumAc_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 FileStatus :
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  NO_SPACE = 2,
42  BAD_SIZE = 4,
59  };
60 
62  using t = enum T;
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Constants
68  // ----------------------------------------------------------------------
69 
70  enum {
75  };
76 
77  public:
78 
79  // ----------------------------------------------------------------------
80  // Constructors
81  // ----------------------------------------------------------------------
82 
85  {
86  this->e = OP_OK;
87  }
88 
91  const enum T e1
92  )
93  {
94  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
95  this->e = e1;
96  }
97 
100  const SerialType e1
101  )
102  {
103  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
104  this->e = static_cast<enum T>(e1);
105  }
106 
109  const FileStatus& obj
110  )
111  {
112  this->e = obj.e;
113 #ifdef BUILD_UT
114  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
115  this->m_serializeValue = obj.m_serializeValue;
116 #endif
117  }
118 
119  public:
120 
121  // ----------------------------------------------------------------------
122  // Operators
123  // ----------------------------------------------------------------------
124 
127  const FileStatus& obj
128  );
129 
132  SerialType e1
133  );
134 
137  enum T e1
138  );
139 
141  operator enum T() const
142  {
143  return this->e;
144  }
145 
147  bool operator==(enum T e1) const
148  {
149  return this->e == e1;
150  }
151 
153  bool operator!=(enum T e1) const
154  {
155  return !(*this == e1);
156  }
157 
158 #ifdef BUILD_UT
159 
161  friend std::ostream& operator<<(
162  std::ostream& os,
163  const FileStatus& obj
164  );
165 
166 #endif
167 
168  public:
169 
170  // ----------------------------------------------------------------------
171  // Member functions
172  // ----------------------------------------------------------------------
173 
175  bool isValid() const;
176 
179  Fw::SerialBufferBase& buffer,
181  ) const;
182 
185  Fw::SerialBufferBase& buffer,
187  );
188 
189 #if FW_SERIALIZABLE_TO_STRING
190 
192  void toString(
193  Fw::StringBase& sb
194  ) const;
195 
196 #endif
197 
198 #ifdef BUILD_UT
199 
201  void setSerializeValue(
202  SerialType serializeValue
203  );
204 
205 #endif
206 
207  public:
208 
209  // ----------------------------------------------------------------------
210  // Static functions
211  // ----------------------------------------------------------------------
212 
214  static bool isValid(
215  SerialType serialTypeValue
216  );
217 
218  public:
219 
220  // ----------------------------------------------------------------------
221  // Public member variables
222  // ----------------------------------------------------------------------
223 
225  enum T e;
226 
227  private:
228 
229  // ----------------------------------------------------------------------
230  // Private member variables
231  // ----------------------------------------------------------------------
232 
233 #ifdef BUILD_UT
234 
240  bool m_serializeValueIsSet = false;
241 
243  SerialType m_serializeValue = 0;
244 
245 #endif
246 
247  };
248 
249 }
250 
251 #endif
bool operator==(enum T e1) const
Equality operator.
FileStatus(const SerialType e1)
Constructor (serial representation value)
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
FileStatus(const FileStatus &obj)
Copy constructor.
FileStatus()
Constructor (default value of OP_OK)
The size of the serial representation.
FileStatus(const enum T e1)
Constructor (user-provided value)
enum T t
For backwards compatibility.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
bool isValid() const
Check raw enum value for validity.
file hasn&#39;t been opened yet
bool operator!=(enum T e1) const
Inequality operator.
No permission to read/write file.
File doesn&#39;t exist (for read)
FileStatus & operator=(const FileStatus &obj)
Copy assignment operator (object)
SerializeStatus
forward declaration for string
enum T e
The raw enum value.
file already exist (for CREATE with O_EXCL enabled)
No more available resources.
T
The raw enum type.
A catch-all for other errors. Have to look in implementation-specific code.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
U8 SerialType
The serial representation type.
Path falls outside the configured sandbox directory.
Kernel or file system does not support operation.
Mode for file access is invalid for current operation.
Invalid argument passed in.
Endianness
FPP shadow-enum representing Os::File::Status.
Invalid size parameter.
Operation was successful.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
The number of enumerated constants.