F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
RateLogicEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title RateLogicEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for RateLogic enum
5 // ======================================================================
6 
7 #ifndef Svc_RateLogicEnumAc_HPP
8 #define Svc_RateLogicEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
15 namespace Svc {
16 
18  class RateLogic :
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = I32;
30 
32  enum T {
34  SILENCED = 0,
36  EVERY_MAX = 1,
41  };
42 
44  using t = enum T;
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
52  enum {
57  };
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Constructors
63  // ----------------------------------------------------------------------
64 
67  {
68  this->e = SILENCED;
69  }
70 
73  const enum T e1
74  )
75  {
76  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
77  this->e = e1;
78  }
79 
82  const SerialType e1
83  )
84  {
85  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
86  this->e = static_cast<enum T>(e1);
87  }
88 
91  const RateLogic& obj
92  )
93  {
94  this->e = obj.e;
95 #ifdef BUILD_UT
96  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
97  this->m_serializeValue = obj.m_serializeValue;
98 #endif
99  }
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Operators
105  // ----------------------------------------------------------------------
106 
109  const RateLogic& obj
110  );
111 
114  SerialType e1
115  );
116 
119  enum T e1
120  );
121 
123  operator enum T() const
124  {
125  return this->e;
126  }
127 
129  bool operator==(enum T e1) const
130  {
131  return this->e == e1;
132  }
133 
135  bool operator!=(enum T e1) const
136  {
137  return !(*this == e1);
138  }
139 
140 #ifdef BUILD_UT
141 
143  friend std::ostream& operator<<(
144  std::ostream& os,
145  const RateLogic& obj
146  );
147 
148 #endif
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Member functions
154  // ----------------------------------------------------------------------
155 
157  bool isValid() const;
158 
161  Fw::SerialBufferBase& buffer,
163  ) const;
164 
167  Fw::SerialBufferBase& buffer,
169  );
170 
171 #if FW_SERIALIZABLE_TO_STRING
172 
174  void toString(
175  Fw::StringBase& sb
176  ) const;
177 
178 #endif
179 
180 #ifdef BUILD_UT
181 
183  void setSerializeValue(
184  SerialType serializeValue
185  );
186 
187 #endif
188 
189  public:
190 
191  // ----------------------------------------------------------------------
192  // Static functions
193  // ----------------------------------------------------------------------
194 
196  static bool isValid(
197  SerialType serialTypeValue
198  );
199 
200  public:
201 
202  // ----------------------------------------------------------------------
203  // Public member variables
204  // ----------------------------------------------------------------------
205 
207  enum T e;
208 
209  private:
210 
211  // ----------------------------------------------------------------------
212  // Private member variables
213  // ----------------------------------------------------------------------
214 
215 #ifdef BUILD_UT
216 
222  bool m_serializeValueIsSet = false;
223 
225  SerialType m_serializeValue = 0;
226 
227 #endif
228 
229  };
230 
231 }
232 
233 #endif
bool operator==(enum T e1) const
Equality operator.
Send on updates after MIN ticks since last send OR at MAX ticks between sends.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
The number of enumerated constants.
enum T e
The raw enum value.
Send on updates after MIN ticks since last send.
Send every MAX ticks between sends.
RateLogic(const SerialType e1)
Constructor (serial representation value)
SerializeStatus
forward declaration for string
RateLogic(const RateLogic &obj)
Copy constructor.
No logic applied. Does not send group and freezes counter.
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.
Enumeration for rate logic types for telemetry groups.
RateLogic & operator=(const RateLogic &obj)
Copy assignment operator (object)
RateLogic(const enum T e1)
Constructor (user-provided value)
bool isValid() const
Check raw enum value for validity.
I32 SerialType
The serial representation type.
enum T t
For backwards compatibility.
RateGroupDivider component implementation.
The size of the serial representation.
RateLogic()
Constructor (default value of SILENCED)
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
T
The raw enum type.