F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FlowEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FlowEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Flow enum
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_Cfdp_FlowEnumAc_HPP
8 #define Svc_Ccsds_Cfdp_FlowEnumAc_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 Ccsds {
18 
19  namespace Cfdp {
20 
21  class Flow :
22  public Fw::Serializable
23  {
24 
25  public:
26 
27  // ----------------------------------------------------------------------
28  // Types
29  // ----------------------------------------------------------------------
30 
32  using SerialType = I32;
33 
35  enum T {
39  FROZEN = 1,
40  };
41 
43  using t = enum T;
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
51  enum {
56  };
57 
58  public:
59 
60  // ----------------------------------------------------------------------
61  // Constructors
62  // ----------------------------------------------------------------------
63 
65  Flow()
66  {
67  this->e = NOT_FROZEN;
68  }
69 
72  const enum T e1
73  )
74  {
75  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
76  this->e = e1;
77  }
78 
81  const SerialType e1
82  )
83  {
84  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
85  this->e = static_cast<enum T>(e1);
86  }
87 
90  const Flow& obj
91  )
92  {
93  this->e = obj.e;
94 #ifdef BUILD_UT
95  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
96  this->m_serializeValue = obj.m_serializeValue;
97 #endif
98  }
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Operators
104  // ----------------------------------------------------------------------
105 
107  Flow& operator=(
108  const Flow& obj
109  );
110 
112  Flow& operator=(
113  SerialType e1
114  );
115 
117  Flow& operator=(
118  enum T e1
119  );
120 
122  operator enum T() const
123  {
124  return this->e;
125  }
126 
128  bool operator==(enum T e1) const
129  {
130  return this->e == e1;
131  }
132 
134  bool operator!=(enum T e1) const
135  {
136  return !(*this == e1);
137  }
138 
139 #ifdef BUILD_UT
140 
142  friend std::ostream& operator<<(
143  std::ostream& os,
144  const Flow& obj
145  );
146 
147 #endif
148 
149  public:
150 
151  // ----------------------------------------------------------------------
152  // Member functions
153  // ----------------------------------------------------------------------
154 
156  bool isValid() const;
157 
160  Fw::SerialBufferBase& buffer,
162  ) const;
163 
166  Fw::SerialBufferBase& buffer,
168  );
169 
170 #if FW_SERIALIZABLE_TO_STRING
171 
173  void toString(
174  Fw::StringBase& sb
175  ) const;
176 
177 #endif
178 
179 #ifdef BUILD_UT
180 
182  void setSerializeValue(
183  SerialType serializeValue
184  );
185 
186 #endif
187 
188  public:
189 
190  // ----------------------------------------------------------------------
191  // Static functions
192  // ----------------------------------------------------------------------
193 
195  static bool isValid(
196  SerialType serialTypeValue
197  );
198 
199  public:
200 
201  // ----------------------------------------------------------------------
202  // Public member variables
203  // ----------------------------------------------------------------------
204 
206  enum T e;
207 
208  private:
209 
210  // ----------------------------------------------------------------------
211  // Private member variables
212  // ----------------------------------------------------------------------
213 
214 #ifdef BUILD_UT
215 
221  bool m_serializeValueIsSet = false;
222 
224  SerialType m_serializeValue = 0;
225 
226 #endif
227 
228  };
229 
230  }
231 
232  }
233 
234 }
235 
236 #endif
Flow(const SerialType e1)
Constructor (serial representation value)
Definition: FlowEnumAc.hpp:80
The number of enumerated constants.
Definition: FlowEnumAc.hpp:55
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: FlowEnumAc.cpp:79
Flow(const enum T e1)
Constructor (user-provided value)
Definition: FlowEnumAc.hpp:71
bool operator==(enum T e1) const
Equality operator.
Definition: FlowEnumAc.hpp:128
Flow(const Flow &obj)
Copy constructor.
Definition: FlowEnumAc.hpp:89
The size of the serial representation.
Definition: FlowEnumAc.hpp:53
Flow & operator=(const Flow &obj)
Copy assignment operator (object)
Definition: FlowEnumAc.cpp:23
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
Definition: FlowEnumAc.cpp:97
bool operator!=(enum T e1) const
Inequality operator.
Definition: FlowEnumAc.hpp:134
bool isValid() const
Check raw enum value for validity.
Definition: FlowEnumAc.cpp:73
CFDP channel operations are executing nominally.
Definition: FlowEnumAc.hpp:37
enum T t
For backwards compatibility.
Definition: FlowEnumAc.hpp:43
enum T e
The raw enum value.
Definition: FlowEnumAc.hpp:206
RateGroupDivider component implementation.
Flow()
Constructor (default value of NOT_FROZEN)
Definition: FlowEnumAc.hpp:65
Endianness
I32 SerialType
The serial representation type.
Definition: FlowEnumAc.hpp:32
CFDP channel operations are frozen.
Definition: FlowEnumAc.hpp:39
T
The raw enum type.
Definition: FlowEnumAc.hpp:35
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.