F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DirectiveIdEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DirectiveIdEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DirectiveId enum
5 // ======================================================================
6 
7 #ifndef Svc_Fpy_DirectiveIdEnumAc_HPP
8 #define Svc_Fpy_DirectiveIdEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
17  namespace Fpy {
18 
19  class DirectiveId :
20  public Fw::Serializable
21  {
22 
23  public:
24 
25  // ----------------------------------------------------------------------
26  // Types
27  // ----------------------------------------------------------------------
28 
30  using SerialType = U8;
31 
33  enum T {
34  INVALID = 0,
35  WAIT_REL = 1,
36  WAIT_ABS = 2,
37  GOTO = 3,
38  IF = 4,
39  NO_OP = 5,
41  PUSH_PRM = 7,
42  CONST_CMD = 8,
43  OR = 9,
44  AND = 10,
45  IEQ = 11,
46  INE = 12,
47  ULT = 13,
48  ULE = 14,
49  UGT = 15,
50  UGE = 16,
51  SLT = 17,
52  SLE = 18,
53  SGT = 19,
54  SGE = 20,
55  FEQ = 21,
56  FNE = 22,
57  FLT = 23,
58  FLE = 24,
59  FGT = 25,
60  FGE = 26,
61  NOT = 27,
62  FPTOSI = 28,
63  FPTOUI = 29,
64  SITOFP = 30,
65  UITOFP = 31,
66  ADD = 32,
67  SUB = 33,
68  MUL = 34,
69  UDIV = 35,
70  SDIV = 36,
71  UMOD = 37,
72  SMOD = 38,
73  FADD = 39,
74  FSUB = 40,
75  FMUL = 41,
76  FDIV = 42,
77  FPOW = 43,
78  FLOG = 44,
79  FMOD = 45,
80  FPEXT = 46,
81  FPTRUNC = 47,
82  SIEXT_8_64 = 48,
85  ZIEXT_8_64 = 51,
91  EXIT = 57,
92  ALLOCATE = 58,
94  LOAD_REL = 60,
95  PUSH_VAL = 61,
96  DISCARD = 62,
97  MEMCMP = 63,
98  STACK_CMD = 64,
100  PUSH_TIME = 66,
101  GET_FIELD = 67,
102  PEEK = 68,
103  STORE_REL = 69,
104  CALL = 70,
105  RETURN = 71,
106  LOAD_ABS = 72,
107  STORE_ABS = 73,
109  POP_EVENT = 75,
110  SET_SEED = 76,
111  PUSH_RAND = 77,
113  FFLOOR = 79,
114  IABS = 80,
115  FABS = 81,
116  };
117 
119  using t = enum T;
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Constants
125  // ----------------------------------------------------------------------
126 
127  enum {
132  };
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Constructors
138  // ----------------------------------------------------------------------
139 
142  {
143  this->e = INVALID;
144  }
145 
148  const enum T e1
149  )
150  {
151  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
152  this->e = e1;
153  }
154 
157  const SerialType e1
158  )
159  {
160  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
161  this->e = static_cast<enum T>(e1);
162  }
163 
166  const DirectiveId& obj
167  )
168  {
169  this->e = obj.e;
170 #ifdef BUILD_UT
171  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
172  this->m_serializeValue = obj.m_serializeValue;
173 #endif
174  }
175 
176  public:
177 
178  // ----------------------------------------------------------------------
179  // Operators
180  // ----------------------------------------------------------------------
181 
184  const DirectiveId& obj
185  );
186 
189  SerialType e1
190  );
191 
194  enum T e1
195  );
196 
198  operator enum T() const
199  {
200  return this->e;
201  }
202 
204  bool operator==(enum T e1) const
205  {
206  return this->e == e1;
207  }
208 
210  bool operator!=(enum T e1) const
211  {
212  return !(*this == e1);
213  }
214 
215 #ifdef BUILD_UT
216 
218  friend std::ostream& operator<<(
219  std::ostream& os,
220  const DirectiveId& obj
221  );
222 
223 #endif
224 
225  public:
226 
227  // ----------------------------------------------------------------------
228  // Member functions
229  // ----------------------------------------------------------------------
230 
232  bool isValid() const;
233 
236  Fw::SerialBufferBase& buffer,
238  ) const;
239 
242  Fw::SerialBufferBase& buffer,
244  );
245 
246 #if FW_SERIALIZABLE_TO_STRING
247 
249  void toString(
250  Fw::StringBase& sb
251  ) const;
252 
253 #endif
254 
255 #ifdef BUILD_UT
256 
258  void setSerializeValue(
259  SerialType serializeValue
260  );
261 
262 #endif
263 
264  public:
265 
266  // ----------------------------------------------------------------------
267  // Static functions
268  // ----------------------------------------------------------------------
269 
271  static bool isValid(
272  SerialType serialTypeValue
273  );
274 
275  public:
276 
277  // ----------------------------------------------------------------------
278  // Public member variables
279  // ----------------------------------------------------------------------
280 
282  enum T e;
283 
284  private:
285 
286  // ----------------------------------------------------------------------
287  // Private member variables
288  // ----------------------------------------------------------------------
289 
290 #ifdef BUILD_UT
291 
297  bool m_serializeValueIsSet = false;
298 
300  SerialType m_serializeValue = 0;
301 
302 #endif
303 
304  };
305 
306  }
307 
308 }
309 
310 #endif
DirectiveId(const DirectiveId &obj)
Copy constructor.
DirectiveId()
Constructor (default value of INVALID)
The number of enumerated constants.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
SerializeStatus
forward declaration for string
DirectiveId & operator=(const DirectiveId &obj)
Copy assignment operator (object)
enum T e
The raw enum value.
The size of the serial representation.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
DirectiveId(const enum T e1)
Constructor (user-provided value)
bool isValid() const
Check raw enum value for validity.
T
The raw enum type.
U8 SerialType
The serial representation type.
bool operator==(enum T e1) const
Equality operator.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
RateGroupDivider component implementation.
bool operator!=(enum T e1) const
Inequality operator.
Endianness
enum T t
For backwards compatibility.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
DirectiveId(const SerialType e1)
Constructor (serial representation value)