-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathS1SerializableAc.ref.hpp
More file actions
298 lines (236 loc) · 6.69 KB
/
S1SerializableAc.ref.hpp
File metadata and controls
298 lines (236 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
// ======================================================================
// \title S1SerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for S1 struct
// ======================================================================
#ifndef M_S1SerializableAc_HPP
#define M_S1SerializableAc_HPP
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"
namespace M {
class S1 :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
sizeof(F32) +
sizeof(F64) +
sizeof(I16) +
sizeof(I32) +
sizeof(I64) +
sizeof(I8) +
sizeof(U16) +
sizeof(U32) +
sizeof(U64) +
sizeof(U8) +
sizeof(U8) +
Fw::StringBase::STATIC_SERIALIZED_SIZE(static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
S1();
//! Member constructor
S1(
F32 mF32,
F64 mF64,
I16 mI16,
I32 mI32,
I64 mI64,
I8 mI8,
U16 mU16,
U32 mU32,
U64 mU64,
U8 mU8,
bool mBool,
const Fw::StringBase& mString
);
//! Copy constructor
S1(
const S1& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
S1& operator=(
const S1& obj //!< The source object
);
//! Equality operator
bool operator==(
const S1& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const S1& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const S1& obj //!< The object
);
#endif
public:
// ----------------------------------------------------------------------
// Member functions
// ----------------------------------------------------------------------
//! Serialization
Fw::SerializeStatus serializeTo(
Fw::SerialBufferBase& buffer, //!< The serial buffer
Fw::Endianness mode = Fw::Endianness::BIG //!< Endianness of serialized buffer
) const;
//! Deserialization
Fw::SerializeStatus deserializeFrom(
Fw::SerialBufferBase& buffer, //!< The serial buffer
Fw::Endianness mode = Fw::Endianness::BIG //!< Endianness of serialized buffer
);
//! Get the dynamic serialized size of the struct
FwSizeType serializedSize() const;
#if FW_SERIALIZABLE_TO_STRING
//! Convert struct to string
void toString(
Fw::StringBase& sb //!< The StringBase object to hold the result
) const;
#endif
// ----------------------------------------------------------------------
// Getter functions
// ----------------------------------------------------------------------
//! Get member mF32
F32 get_mF32() const
{
return this->m_mF32;
}
//! Get member mF64
F64 get_mF64() const
{
return this->m_mF64;
}
//! Get member mI16
I16 get_mI16() const
{
return this->m_mI16;
}
//! Get member mI32
I32 get_mI32() const
{
return this->m_mI32;
}
//! Get member mI64
I64 get_mI64() const
{
return this->m_mI64;
}
//! Get member mI8
I8 get_mI8() const
{
return this->m_mI8;
}
//! Get member mU16
U16 get_mU16() const
{
return this->m_mU16;
}
//! Get member mU32
U32 get_mU32() const
{
return this->m_mU32;
}
//! Get member mU64
U64 get_mU64() const
{
return this->m_mU64;
}
//! Get member mU8
U8 get_mU8() const
{
return this->m_mU8;
}
//! Get member mBool
bool get_mBool() const
{
return this->m_mBool;
}
//! Get member mString
Fw::ExternalString& get_mString()
{
return this->m_mString;
}
//! Get member mString (const)
const Fw::ExternalString& get_mString() const
{
return this->m_mString;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(
F32 mF32,
F64 mF64,
I16 mI16,
I32 mI32,
I64 mI64,
I8 mI8,
U16 mU16,
U32 mU32,
U64 mU64,
U8 mU8,
bool mBool,
const Fw::StringBase& mString
);
//! Set member mF32
void set_mF32(F32 mF32);
//! Set member mF64
void set_mF64(F64 mF64);
//! Set member mI16
void set_mI16(I16 mI16);
//! Set member mI32
void set_mI32(I32 mI32);
//! Set member mI64
void set_mI64(I64 mI64);
//! Set member mI8
void set_mI8(I8 mI8);
//! Set member mU16
void set_mU16(U16 mU16);
//! Set member mU32
void set_mU32(U32 mU32);
//! Set member mU64
void set_mU64(U64 mU64);
//! Set member mU8
void set_mU8(U8 mU8);
//! Set member mBool
void set_mBool(bool mBool);
//! Set member mString
void set_mString(const Fw::StringBase& mString);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
F32 m_mF32;
F64 m_mF64;
I16 m_mI16;
I32 m_mI32;
I64 m_mI64;
I8 m_mI8;
U16 m_mU16;
U32 m_mU32;
U64 m_mU64;
U8 m_mU8;
bool m_mBool;
char m___fprime_ac_mString_buffer[Fw::StringBase::BUFFER_SIZE(static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))];
Fw::ExternalString m_mString;
};
}
#endif