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
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
8#include "Fw/Types/Assert.hpp"
9
10namespace Svc {
11
12 // ----------------------------------------------------------------------
13 // Constructors
14 // ----------------------------------------------------------------------
15
16 SendFileResponse ::
17 SendFileResponse() :
18 Serializable(),
19 m_status(Svc::SendFileStatus::STATUS_OK),
20 m_context(0)
21 {
22
23 }
24
25 SendFileResponse ::
26 SendFileResponse(
28 U32 context
29 ) :
30 Serializable(),
31 m_status(status),
32 m_context(context)
33 {
34
35 }
36
37 SendFileResponse ::
38 SendFileResponse(const SendFileResponse& obj) :
39 Serializable(),
40 m_status(obj.m_status),
41 m_context(obj.m_context)
42 {
43
44 }
45
46 // ----------------------------------------------------------------------
47 // Operators
48 // ----------------------------------------------------------------------
49
50 SendFileResponse& SendFileResponse ::
51 operator=(const SendFileResponse& obj)
52 {
53 if (this == &obj) {
54 return *this;
55 }
56
57 set(obj.m_status, obj.m_context);
58 return *this;
59 }
60
61 bool SendFileResponse ::
62 operator==(const SendFileResponse& obj) const
63 {
64 return (
65 (this->m_status == obj.m_status) &&
66 (this->m_context == obj.m_context)
67 );
68 }
69
70 bool SendFileResponse ::
71 operator!=(const SendFileResponse& obj) const
72 {
73 return !(*this == obj);
74 }
75
76#ifdef BUILD_UT
77
78 std::ostream& operator<<(std::ostream& os, const SendFileResponse& obj) {
79 Fw::String s;
80 obj.toString(s);
81 os << s.toChar();
82 return os;
83 }
84
85#endif
86
87 // ----------------------------------------------------------------------
88 // Member functions
89 // ----------------------------------------------------------------------
90
91 Fw::SerializeStatus SendFileResponse ::
92 serialize(Fw::SerializeBufferBase& buffer) const
93 {
95
96 status = buffer.serialize(this->m_status);
97 if (status != Fw::FW_SERIALIZE_OK) {
98 return status;
99 }
100 status = buffer.serialize(this->m_context);
101 if (status != Fw::FW_SERIALIZE_OK) {
102 return status;
103 }
104
105 return status;
106 }
107
108 Fw::SerializeStatus SendFileResponse ::
109 deserialize(Fw::SerializeBufferBase& buffer)
110 {
111 Fw::SerializeStatus status;
112
113 status = buffer.deserialize(this->m_status);
114 if (status != Fw::FW_SERIALIZE_OK) {
115 return status;
116 }
117 status = buffer.deserialize(this->m_context);
118 if (status != Fw::FW_SERIALIZE_OK) {
119 return status;
120 }
121
122 return status;
123 }
124
125#if FW_SERIALIZABLE_TO_STRING
126
127 void SendFileResponse ::
128 toString(Fw::StringBase& sb) const
129 {
130 static const char* formatString =
131 "( "
132 "status = %s, "
133 "context = %" PRIu32 ""
134 " )";
135
136 // Declare strings to hold any serializable toString() arguments
137 Fw::String statusStr;
138
139 // Call toString for arrays and serializable types
140 this->m_status.toString(statusStr);
141
142 sb.format(
143 formatString,
144 statusStr.toChar(),
145 this->m_context
146 );
147 }
148
149#endif
150
151 // ----------------------------------------------------------------------
152 // Setter functions
153 // ----------------------------------------------------------------------
154
155 void SendFileResponse ::
156 set(
158 U32 context
159 )
160 {
161 this->m_status = status;
162 this->m_context = context;
163 }
164
165 void SendFileResponse ::
166 setstatus(Svc::SendFileStatus::T status)
167 {
168 this->m_status = status;
169 }
170
171 void SendFileResponse ::
172 setcontext(U32 context)
173 {
174 this->m_context = context;
175 }
176
177}
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
const char * toChar() const
Definition String.hpp:50
Send file status enum.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.