F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeComparisonEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeComparisonEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TimeComparison enum
5 // ======================================================================
6 
7 #ifndef Fw_TimeComparisonEnumAc_HPP
8 #define Fw_TimeComparisonEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Fw {
16 
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  using SerialType = I32;
29 
31  enum T {
32  LT = -1,
33  EQ = 0,
34  GT = 1,
36  };
37 
39  using t = enum T;
40 
41  public:
42 
43  // ----------------------------------------------------------------------
44  // Constants
45  // ----------------------------------------------------------------------
46 
47  enum {
52  };
53 
54  public:
55 
56  // ----------------------------------------------------------------------
57  // Constructors
58  // ----------------------------------------------------------------------
59 
62  {
63  this->e = LT;
64  }
65 
68  const enum T e1
69  )
70  {
71  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
72  this->e = e1;
73  }
74 
77  const SerialType e1
78  )
79  {
80  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
81  this->e = static_cast<enum T>(e1);
82  }
83 
86  const TimeComparison& obj
87  )
88  {
89  this->e = obj.e;
90 #ifdef BUILD_UT
91  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
92  this->m_serializeValue = obj.m_serializeValue;
93 #endif
94  }
95 
96  public:
97 
98  // ----------------------------------------------------------------------
99  // Operators
100  // ----------------------------------------------------------------------
101 
104  const TimeComparison& obj
105  );
106 
109  SerialType e1
110  );
111 
114  enum T e1
115  );
116 
118  operator enum T() const
119  {
120  return this->e;
121  }
122 
124  bool operator==(enum T e1) const
125  {
126  return this->e == e1;
127  }
128 
130  bool operator!=(enum T e1) const
131  {
132  return !(*this == e1);
133  }
134 
135 #ifdef BUILD_UT
136 
138  friend std::ostream& operator<<(
139  std::ostream& os,
140  const TimeComparison& obj
141  );
142 
143 #endif
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Member functions
149  // ----------------------------------------------------------------------
150 
152  bool isValid() const;
153 
156  Fw::SerialBufferBase& buffer,
158  ) const;
159 
162  Fw::SerialBufferBase& buffer,
164  );
165 
166 #if FW_SERIALIZABLE_TO_STRING
167 
169  void toString(
170  Fw::StringBase& sb
171  ) const;
172 
173 #endif
174 
175 #ifdef BUILD_UT
176 
178  void setSerializeValue(
179  SerialType serializeValue
180  );
181 
182 #endif
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Static functions
188  // ----------------------------------------------------------------------
189 
191  static bool isValid(
192  SerialType serialTypeValue
193  );
194 
195  public:
196 
197  // ----------------------------------------------------------------------
198  // Public member variables
199  // ----------------------------------------------------------------------
200 
202  enum T e;
203 
204  private:
205 
206  // ----------------------------------------------------------------------
207  // Private member variables
208  // ----------------------------------------------------------------------
209 
210 #ifdef BUILD_UT
211 
217  bool m_serializeValueIsSet = false;
218 
220  SerialType m_serializeValue = 0;
221 
222 #endif
223 
224  };
225 
226 }
227 
228 #endif
enum T t
For backwards compatibility.
T
The raw enum type.
TimeComparison(const SerialType e1)
Constructor (serial representation value)
TimeComparison(const TimeComparison &obj)
Copy constructor.
The size of the serial representation.
TimeComparison()
Constructor (default value of LT)
bool operator==(enum T e1) const
Equality operator.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
TimeComparison & operator=(const TimeComparison &obj)
Copy assignment operator (object)
TimeComparison(const enum T e1)
Constructor (user-provided value)
enum T e
The raw enum value.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
bool operator!=(enum T e1) const
Inequality operator.
Implementation of malloc based allocator.
Endianness
The number of enumerated constants.
bool isValid() const
Check raw enum value for validity.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
I32 SerialType
The serial representation type.
Big endian serialization.