F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SendFileResponseSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SendFileResponseSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for SendFileResponse struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  // ----------------------------------------------------------------------
13  // Constructors
14  // ----------------------------------------------------------------------
15 
18  Serializable(),
19  m_status(Svc::SendFileStatus::STATUS_OK),
20  m_context(0)
21  {
22 
23  }
24 
28  U32 context
29  ) :
30  Serializable(),
31  m_status(status),
32  m_context(context)
33  {
34 
35  }
36 
39  Serializable(),
40  m_status(obj.m_status),
41  m_context(obj.m_context)
42  {
43 
44  }
45 
46  // ----------------------------------------------------------------------
47  // Operators
48  // ----------------------------------------------------------------------
49 
52  {
53  if (this == &obj) {
54  return *this;
55  }
56 
57  set(obj.m_status, obj.m_context);
58  return *this;
59  }
60 
62  operator==(const SendFileResponse& obj) const
63  {
64  if (this == &obj) { return true; }
65  return (
66  (this->m_status == obj.m_status) &&
67  (this->m_context == obj.m_context)
68  );
69  }
70 
72  operator!=(const SendFileResponse& obj) const
73  {
74  return !(*this == obj);
75  }
76 
77 #ifdef BUILD_UT
78 
79  std::ostream& operator<<(std::ostream& os, const SendFileResponse& obj) {
80  Fw::String s;
81  obj.toString(s);
82  os << s.toChar();
83  return os;
84  }
85 
86 #endif
87 
88  // ----------------------------------------------------------------------
89  // Member functions
90  // ----------------------------------------------------------------------
91 
94  {
95  Fw::SerializeStatus status;
96 
97  status = buffer.serialize(this->m_status);
98  if (status != Fw::FW_SERIALIZE_OK) {
99  return status;
100  }
101  status = buffer.serialize(this->m_context);
102  if (status != Fw::FW_SERIALIZE_OK) {
103  return status;
104  }
105 
106  return status;
107  }
108 
111  {
112  Fw::SerializeStatus status;
113 
114  status = buffer.deserialize(this->m_status);
115  if (status != Fw::FW_SERIALIZE_OK) {
116  return status;
117  }
118  status = buffer.deserialize(this->m_context);
119  if (status != Fw::FW_SERIALIZE_OK) {
120  return status;
121  }
122 
123  return status;
124  }
125 
126 #if FW_SERIALIZABLE_TO_STRING
127 
128  void SendFileResponse ::
129  toString(Fw::StringBase& sb) const
130  {
131  Fw::String tmp;
132  sb = "( ";
133 
134  // Format status
135  sb += "status = ";
136  this->m_status.toString(tmp);
137  sb += tmp;
138  sb += ", ";
139 
140  // Format context
141  sb += "context = ";
142  tmp.format("%" PRIu32 "", this->m_context);
143  sb += tmp;
144  sb += " )";
145  }
146 
147 #endif
148 
149  // ----------------------------------------------------------------------
150  // Setter functions
151  // ----------------------------------------------------------------------
152 
155  Svc::SendFileStatus::T status,
156  U32 context
157  )
158  {
159  this->m_status = status;
160  this->m_context = context;
161  }
162 
165  {
166  this->m_status = status;
167  }
168 
170  setcontext(U32 context)
171  {
172  this->m_context = context;
173  }
174 
175 }
Serialization/Deserialization operation was successful.
SendFileResponse & operator=(const SendFileResponse &obj)
Copy assignment operator.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
Definition: String.hpp:50
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialization.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialization.
SendFileResponse()
Constructor (default value)
void setcontext(U32 context)
Set member context.
SerializeStatus
forward declaration for string
bool operator!=(const SendFileResponse &obj) const
Inequality operator.
void setstatus(Svc::SendFileStatus::T status)
Set member status.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Send file response struct.
RateGroupDivider component implementation.
Send file status enum.
bool operator==(const SendFileResponse &obj) const
Equality operator.
void set(Svc::SendFileStatus::T status, U32 context)
Set all members.