F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DirectoryStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DirectoryStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DirectoryStatus enum
5 // ======================================================================
6 
7 #ifndef Os_DirectoryStatusEnumAc_HPP
8 #define Os_DirectoryStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Os {
16 
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,
42  NOT_DIR = 4,
55  };
56 
58  using t = enum T;
59 
60  public:
61 
62  // ----------------------------------------------------------------------
63  // Constants
64  // ----------------------------------------------------------------------
65 
66  enum {
71  };
72 
73  public:
74 
75  // ----------------------------------------------------------------------
76  // Constructors
77  // ----------------------------------------------------------------------
78 
81  {
82  this->e = OP_OK;
83  }
84 
87  const enum T e1
88  )
89  {
90  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
91  this->e = e1;
92  }
93 
96  const SerialType e1
97  )
98  {
99  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
100  this->e = static_cast<enum T>(e1);
101  }
102 
105  const DirectoryStatus& obj
106  )
107  {
108  this->e = obj.e;
109 #ifdef BUILD_UT
110  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
111  this->m_serializeValue = obj.m_serializeValue;
112 #endif
113  }
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Operators
119  // ----------------------------------------------------------------------
120 
123  const DirectoryStatus& obj
124  );
125 
128  SerialType e1
129  );
130 
133  enum T e1
134  );
135 
137  operator enum T() const
138  {
139  return this->e;
140  }
141 
143  bool operator==(enum T e1) const
144  {
145  return this->e == e1;
146  }
147 
149  bool operator!=(enum T e1) const
150  {
151  return !(*this == e1);
152  }
153 
154 #ifdef BUILD_UT
155 
157  friend std::ostream& operator<<(
158  std::ostream& os,
159  const DirectoryStatus& obj
160  );
161 
162 #endif
163 
164  public:
165 
166  // ----------------------------------------------------------------------
167  // Member functions
168  // ----------------------------------------------------------------------
169 
171  bool isValid() const;
172 
175  Fw::SerialBufferBase& buffer,
177  ) const;
178 
181  Fw::SerialBufferBase& buffer,
183  );
184 
185 #if FW_SERIALIZABLE_TO_STRING
186 
188  void toString(
189  Fw::StringBase& sb
190  ) const;
191 
192 #endif
193 
194 #ifdef BUILD_UT
195 
197  void setSerializeValue(
198  SerialType serializeValue
199  );
200 
201 #endif
202 
203  public:
204 
205  // ----------------------------------------------------------------------
206  // Static functions
207  // ----------------------------------------------------------------------
208 
210  static bool isValid(
211  SerialType serialTypeValue
212  );
213 
214  public:
215 
216  // ----------------------------------------------------------------------
217  // Public member variables
218  // ----------------------------------------------------------------------
219 
221  enum T e;
222 
223  private:
224 
225  // ----------------------------------------------------------------------
226  // Private member variables
227  // ----------------------------------------------------------------------
228 
229 #ifdef BUILD_UT
230 
236  bool m_serializeValueIsSet = false;
237 
239  SerialType m_serializeValue = 0;
240 
241 #endif
242 
243  };
244 
245 }
246 
247 #endif
bool operator==(enum T e1) const
Equality operator.
enum T t
For backwards compatibility.
Operation was successful.
bool operator!=(enum T e1) const
Inequality operator.
DirectoryStatus(const SerialType e1)
Constructor (serial representation value)
The number of enumerated constants.
DirectoryStatus(const enum T e1)
Constructor (user-provided value)
SerializeStatus
forward declaration for string
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.
A catch-all for other errors. Have to look in implementation-specific code.
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.
The size of the serial representation.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
enum T e
The raw enum value.
FPP shadow-enum representing Os::Directory::Status.
Directory hasn&#39;t been opened yet.
Directory stream descriptor is invalid.
No permission to read directory.
Directory stream has no more files.
DirectoryStatus & operator=(const DirectoryStatus &obj)
Copy assignment operator (object)
DirectoryStatus(const DirectoryStatus &obj)
Copy constructor.
Directory has more files than can be read.
Operation is not supported by the current implementation.
Directory doesn&#39;t exist.
Endianness
DirectoryStatus()
Constructor (default value of OP_OK)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.