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 TimeComparison& obj
78  )
79  {
80  this->e = obj.e;
81 #ifdef BUILD_UT
82  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
83  this->m_serializeValue = obj.m_serializeValue;
84 #endif
85  }
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Operators
91  // ----------------------------------------------------------------------
92 
95  const TimeComparison& obj
96  );
97 
100  enum T e1
101  );
102 
104  operator enum T() const
105  {
106  return this->e;
107  }
108 
110  bool operator==(enum T e1) const
111  {
112  return this->e == e1;
113  }
114 
116  bool operator!=(enum T e1) const
117  {
118  return !(*this == e1);
119  }
120 
121 #ifdef BUILD_UT
122 
124  friend std::ostream& operator<<(
125  std::ostream& os,
126  const TimeComparison& obj
127  );
128 
129 #endif
130 
131  public:
132 
133  // ----------------------------------------------------------------------
134  // Member functions
135  // ----------------------------------------------------------------------
136 
138  bool isValid() const;
139 
142  Fw::SerialBufferBase& buffer,
144  ) const;
145 
148  Fw::SerialBufferBase& buffer,
150  );
151 
152 #if FW_SERIALIZABLE_TO_STRING
153 
155  void toString(
156  Fw::StringBase& sb
157  ) const;
158 
159 #endif
160 
161 #ifdef BUILD_UT
162 
164  void setSerializeValue(
165  SerialType serializeValue
166  );
167 
168 #endif
169 
170  public:
171 
172  // ----------------------------------------------------------------------
173  // Static functions
174  // ----------------------------------------------------------------------
175 
177  static bool isValid(
178  SerialType serialTypeValue
179  );
180 
181  public:
182 
183  // ----------------------------------------------------------------------
184  // Public member variables
185  // ----------------------------------------------------------------------
186 
188  enum T e;
189 
190  private:
191 
192  // ----------------------------------------------------------------------
193  // Private member variables
194  // ----------------------------------------------------------------------
195 
196 #ifdef BUILD_UT
197 
203  bool m_serializeValueIsSet = false;
204 
206  SerialType m_serializeValue = 0;
207 
208 #endif
209 
210  };
211 
212 }
213 
214 #endif
enum T t
For backwards compatibility.
T
The raw enum type.
TimeComparison(const TimeComparison &obj)
Copy constructor.
TimeComparison()
Constructor (default value of LT)
bool operator==(enum T e1) const
Equality operator.
The size of the serial representation.
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.
The number of enumerated constants.
Implementation of malloc based allocator.
Endianness
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.