F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BlockStateEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BlockStateEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for BlockState enum
5 // ======================================================================
6 
7 #ifndef Svc_BlockStateEnumAc_HPP
8 #define Svc_BlockStateEnumAc_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 BlockState :
19  public Fw::Serializable
20  {
21 
22  public:
23 
24  // ----------------------------------------------------------------------
25  // Types
26  // ----------------------------------------------------------------------
27 
29  using SerialType = U8;
30 
32  enum T {
33  BLOCK = 0,
34  NO_BLOCK = 1,
35  };
36 
38  using t = enum T;
39 
40  public:
41 
42  // ----------------------------------------------------------------------
43  // Constants
44  // ----------------------------------------------------------------------
45 
46  enum {
51  };
52 
53  public:
54 
55  // ----------------------------------------------------------------------
56  // Constructors
57  // ----------------------------------------------------------------------
58 
61  {
62  this->e = BLOCK;
63  }
64 
67  const enum T e1
68  )
69  {
70  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
71  this->e = e1;
72  }
73 
76  const SerialType e1
77  )
78  {
79  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
80  this->e = static_cast<enum T>(e1);
81  }
82 
85  const BlockState& obj
86  )
87  {
88  this->e = obj.e;
89 #ifdef BUILD_UT
90  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
91  this->m_serializeValue = obj.m_serializeValue;
92 #endif
93  }
94 
95  public:
96 
97  // ----------------------------------------------------------------------
98  // Operators
99  // ----------------------------------------------------------------------
100 
103  const BlockState& obj
104  );
105 
108  SerialType e1
109  );
110 
113  enum T e1
114  );
115 
117  operator enum T() const
118  {
119  return this->e;
120  }
121 
123  bool operator==(enum T e1) const
124  {
125  return this->e == e1;
126  }
127 
129  bool operator!=(enum T e1) const
130  {
131  return !(*this == e1);
132  }
133 
134 #ifdef BUILD_UT
135 
137  friend std::ostream& operator<<(
138  std::ostream& os,
139  const BlockState& obj
140  );
141 
142 #endif
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Member functions
148  // ----------------------------------------------------------------------
149 
151  bool isValid() const;
152 
155  Fw::SerialBufferBase& buffer,
157  ) const;
158 
161  Fw::SerialBufferBase& buffer,
163  );
164 
165 #if FW_SERIALIZABLE_TO_STRING
166 
168  void toString(
169  Fw::StringBase& sb
170  ) const;
171 
172 #endif
173 
174 #ifdef BUILD_UT
175 
177  void setSerializeValue(
178  SerialType serializeValue
179  );
180 
181 #endif
182 
183  public:
184 
185  // ----------------------------------------------------------------------
186  // Static functions
187  // ----------------------------------------------------------------------
188 
190  static bool isValid(
191  SerialType serialTypeValue
192  );
193 
194  public:
195 
196  // ----------------------------------------------------------------------
197  // Public member variables
198  // ----------------------------------------------------------------------
199 
201  enum T e;
202 
203  private:
204 
205  // ----------------------------------------------------------------------
206  // Private member variables
207  // ----------------------------------------------------------------------
208 
209 #ifdef BUILD_UT
210 
216  bool m_serializeValueIsSet = false;
217 
219  SerialType m_serializeValue = 0;
220 
221 #endif
222 
223  };
224 
225 }
226 
227 #endif
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
bool operator==(enum T e1) const
Equality operator.
BlockState(const SerialType e1)
Constructor (serial representation value)
BlockState(const enum T e1)
Constructor (user-provided value)
T
The raw enum type.
SerializeStatus
forward declaration for string
The size of the serial representation.
bool operator!=(enum T e1) const
Inequality operator.
U8 SerialType
The serial representation type.
BlockState()
Constructor (default value of BLOCK)
Sequencer blocking state.
The number of enumerated constants.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
enum T t
For backwards compatibility.
BlockState & operator=(const BlockState &obj)
Copy assignment operator (object)
RateGroupDivider component implementation.
Endianness
#define FW_ASSERT(...)
Definition: Assert.hpp:14
bool isValid() const
Check raw enum value for validity.
Big endian serialization.
BlockState(const BlockState &obj)
Copy constructor.
enum T e
The raw enum value.