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 Flow& obj
82  )
83  {
84  this->e = obj.e;
85 #ifdef BUILD_UT
86  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
87  this->m_serializeValue = obj.m_serializeValue;
88 #endif
89  }
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Operators
95  // ----------------------------------------------------------------------
96 
98  Flow& operator=(
99  const Flow& obj
100  );
101 
103  Flow& operator=(
104  enum T e1
105  );
106 
108  operator enum T() const
109  {
110  return this->e;
111  }
112 
114  bool operator==(enum T e1) const
115  {
116  return this->e == e1;
117  }
118 
120  bool operator!=(enum T e1) const
121  {
122  return !(*this == e1);
123  }
124 
125 #ifdef BUILD_UT
126 
128  friend std::ostream& operator<<(
129  std::ostream& os,
130  const Flow& obj
131  );
132 
133 #endif
134 
135  public:
136 
137  // ----------------------------------------------------------------------
138  // Member functions
139  // ----------------------------------------------------------------------
140 
142  bool isValid() const;
143 
146  Fw::SerialBufferBase& buffer,
148  ) const;
149 
152  Fw::SerialBufferBase& buffer,
154  );
155 
156 #if FW_SERIALIZABLE_TO_STRING
157 
159  void toString(
160  Fw::StringBase& sb
161  ) const;
162 
163 #endif
164 
165 #ifdef BUILD_UT
166 
168  void setSerializeValue(
169  SerialType serializeValue
170  );
171 
172 #endif
173 
174  public:
175 
176  // ----------------------------------------------------------------------
177  // Static functions
178  // ----------------------------------------------------------------------
179 
181  static bool isValid(
182  SerialType serialTypeValue
183  );
184 
185  public:
186 
187  // ----------------------------------------------------------------------
188  // Public member variables
189  // ----------------------------------------------------------------------
190 
192  enum T e;
193 
194  private:
195 
196  // ----------------------------------------------------------------------
197  // Private member variables
198  // ----------------------------------------------------------------------
199 
200 #ifdef BUILD_UT
201 
207  bool m_serializeValueIsSet = false;
208 
210  SerialType m_serializeValue = 0;
211 
212 #endif
213 
214  };
215 
216  }
217 
218  }
219 
220 }
221 
222 #endif
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
Definition: FlowEnumAc.cpp:67
Flow(const enum T e1)
Constructor (user-provided value)
Definition: FlowEnumAc.hpp:71
The size of the serial representation.
Definition: FlowEnumAc.hpp:53
bool operator==(enum T e1) const
Equality operator.
Definition: FlowEnumAc.hpp:114
The number of enumerated constants.
Definition: FlowEnumAc.hpp:55
Flow(const Flow &obj)
Copy constructor.
Definition: FlowEnumAc.hpp:80
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:85
bool operator!=(enum T e1) const
Inequality operator.
Definition: FlowEnumAc.hpp:120
bool isValid() const
Check raw enum value for validity.
Definition: FlowEnumAc.cpp:61
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:192
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.