F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StatementSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title StatementSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for Statement struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  namespace Fpy {
13 
14  // ----------------------------------------------------------------------
15  // Constructors
16  // ----------------------------------------------------------------------
17 
20  Serializable(),
21  m_opCode(Svc::Fpy::DirectiveId::INVALID),
22  m_argBuf()
23  {
24 
25  }
26 
30  const Fw::StatementArgBuffer& argBuf
31  ) :
32  Serializable(),
33  m_opCode(opCode),
34  m_argBuf(argBuf)
35  {
36 
37  }
38 
40  Statement(const Statement& obj) :
41  Serializable(),
42  m_opCode(obj.m_opCode),
43  m_argBuf(obj.m_argBuf)
44  {
45 
46  }
47 
48  // ----------------------------------------------------------------------
49  // Operators
50  // ----------------------------------------------------------------------
51 
53  operator=(const Statement& obj)
54  {
55  if (this == &obj) {
56  return *this;
57  }
58 
59  set(obj.m_opCode, obj.m_argBuf);
60  return *this;
61  }
62 
63  bool Statement ::
64  operator==(const Statement& obj) const
65  {
66  if (this == &obj) { return true; }
67  return (
68  (this->m_opCode == obj.m_opCode) &&
69  (this->m_argBuf == obj.m_argBuf)
70  );
71  }
72 
73  bool Statement ::
74  operator!=(const Statement& obj) const
75  {
76  return !(*this == obj);
77  }
78 
79 #ifdef BUILD_UT
80 
81  std::ostream& operator<<(std::ostream& os, const Statement& obj) {
82  Fw::String s;
83  obj.toString(s);
84  os << s.toChar();
85  return os;
86  }
87 
88 #endif
89 
90  // ----------------------------------------------------------------------
91  // Member functions
92  // ----------------------------------------------------------------------
93 
96  {
97  Fw::SerializeStatus status;
98 
99  status = buffer.serializeFrom(this->m_opCode);
100  if (status != Fw::FW_SERIALIZE_OK) {
101  return status;
102  }
103  status = buffer.serializeFrom(this->m_argBuf);
104  if (status != Fw::FW_SERIALIZE_OK) {
105  return status;
106  }
107 
108  return status;
109  }
110 
113  {
114  Fw::SerializeStatus status;
115 
116  status = buffer.deserializeTo(this->m_opCode);
117  if (status != Fw::FW_SERIALIZE_OK) {
118  return status;
119  }
120  status = buffer.deserializeTo(this->m_argBuf);
121  if (status != Fw::FW_SERIALIZE_OK) {
122  return status;
123  }
124 
125  return status;
126  }
127 
130  {
131  FwSizeType size = 0;
134  return size;
135  }
136 
137 #if FW_SERIALIZABLE_TO_STRING
138 
139  void Statement ::
140  toString(Fw::StringBase& sb) const
141  {
142  Fw::String tmp;
143  sb = "( ";
144 
145  // Format opCode
146  sb += "opCode = ";
147  this->m_opCode.toString(tmp);
148  sb += tmp;
149  sb += ", ";
150 
151  // Format argBuf
152  sb += "argBuf = ";
153  this->m_argBuf.toString(tmp);
154  sb += tmp;
155  sb += " )";
156  }
157 
158 #endif
159 
160  // ----------------------------------------------------------------------
161  // Setter functions
162  // ----------------------------------------------------------------------
163 
164  void Statement ::
167  const Fw::StatementArgBuffer& argBuf
168  )
169  {
170  this->m_opCode = opCode;
171  this->m_argBuf = argBuf;
172  }
173 
174  void Statement ::
176  {
177  this->m_opCode = opCode;
178  }
179 
180  void Statement ::
182  {
183  this->m_argBuf = argBuf;
184  }
185 
186  }
187 
188 }
Serialization/Deserialization operation was successful.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
The size of the serial representation.
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer)
Deserialization.
PlatformSizeType FwSizeType
const char * toChar() const
Definition: String.hpp:50
bool operator!=(const Statement &obj) const
Inequality operator.
Fw::StatementArgBuffer m_argBuf
SerializeStatus
forward declaration for string
void set_opCode(Svc::Fpy::DirectiveId::T opCode)
Set member opCode.
Statement()
Constructor (default value)
a statement is a directive opcode paired with an argument buffer
Statement & operator=(const Statement &obj)
Copy assignment operator.
void set_argBuf(const Fw::StatementArgBuffer &argBuf)
Set member argBuf.
void set(Svc::Fpy::DirectiveId::T opCode, const Fw::StatementArgBuffer &argBuf)
Set all members.
T
The raw enum type.
RateGroupDivider component implementation.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
bool operator==(const Statement &obj) const
Equality operator.
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const
Serialization.
Svc::Fpy::DirectiveId m_opCode
SerializeStatus deserializeTo(U8 &val)
deserialize 8-bit unsigned int