fpp/compiler/tools/fpp-to-cpp/test/struct/FormatSerializableAc.ref.cpp
2025-11-16 13:40:21 -08:00

607 lines
11 KiB
C++
Vendored

// ======================================================================
// \title FormatSerializableAc.cpp
// \author Generated by fpp-to-cpp
// \brief cpp file for Format struct
// ======================================================================
#include "FormatSerializableAc.hpp"
#include "Fw/Types/Assert.hpp"
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
Format ::
Format() :
Serializable(),
m_m1{},
m_m2{},
m_m3{},
m_m4{},
m_m5{},
m_m6{},
m_m7{},
m_m8{},
m_m9{},
m_m10{},
m_m11{},
m_m12{},
m_m13{},
m_m14{},
m_m15{},
m_m16{},
m_m17{}
{
}
Format ::
Format(
I32 m1,
U32 m2,
I32 m3,
U32 m4,
I32 m5,
U32 m6,
I32 m7,
U32 m8,
I32 m9,
U32 m10,
F32 m11,
F32 m12,
F32 m13,
F32 m14,
F32 m15,
F32 m16,
F32 m17
) :
Serializable(),
m_m1(m1),
m_m2(m2),
m_m3(m3),
m_m4(m4),
m_m5(m5),
m_m6(m6),
m_m7(m7),
m_m8(m8),
m_m9(m9),
m_m10(m10),
m_m11(m11),
m_m12(m12),
m_m13(m13),
m_m14(m14),
m_m15(m15),
m_m16(m16),
m_m17(m17)
{
}
Format ::
Format(const Format& obj) :
Serializable(),
m_m1(obj.m_m1),
m_m2(obj.m_m2),
m_m3(obj.m_m3),
m_m4(obj.m_m4),
m_m5(obj.m_m5),
m_m6(obj.m_m6),
m_m7(obj.m_m7),
m_m8(obj.m_m8),
m_m9(obj.m_m9),
m_m10(obj.m_m10),
m_m11(obj.m_m11),
m_m12(obj.m_m12),
m_m13(obj.m_m13),
m_m14(obj.m_m14),
m_m15(obj.m_m15),
m_m16(obj.m_m16),
m_m17(obj.m_m17)
{
}
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
Format& Format ::
operator=(const Format& obj)
{
if (this == &obj) {
return *this;
}
set(obj.m_m1, obj.m_m2, obj.m_m3, obj.m_m4, obj.m_m5, obj.m_m6, obj.m_m7, obj.m_m8, obj.m_m9, obj.m_m10, obj.m_m11, obj.m_m12, obj.m_m13, obj.m_m14, obj.m_m15, obj.m_m16, obj.m_m17);
return *this;
}
bool Format ::
operator==(const Format& obj) const
{
if (this == &obj) { return true; }
return (
(this->m_m1 == obj.m_m1) &&
(this->m_m2 == obj.m_m2) &&
(this->m_m3 == obj.m_m3) &&
(this->m_m4 == obj.m_m4) &&
(this->m_m5 == obj.m_m5) &&
(this->m_m6 == obj.m_m6) &&
(this->m_m7 == obj.m_m7) &&
(this->m_m8 == obj.m_m8) &&
(this->m_m9 == obj.m_m9) &&
(this->m_m10 == obj.m_m10) &&
(this->m_m11 == obj.m_m11) &&
(this->m_m12 == obj.m_m12) &&
(this->m_m13 == obj.m_m13) &&
(this->m_m14 == obj.m_m14) &&
(this->m_m15 == obj.m_m15) &&
(this->m_m16 == obj.m_m16) &&
(this->m_m17 == obj.m_m17)
);
}
bool Format ::
operator!=(const Format& obj) const
{
return !(*this == obj);
}
#ifdef BUILD_UT
std::ostream& operator<<(std::ostream& os, const Format& obj) {
Fw::String s;
obj.toString(s);
os << s.toChar();
return os;
}
#endif
// ----------------------------------------------------------------------
// Member functions
// ----------------------------------------------------------------------
Fw::SerializeStatus Format ::
serializeTo(
Fw::SerialBufferBase& buffer,
Fw::Endianness mode
) const
{
Fw::SerializeStatus status;
status = buffer.serializeFrom(this->m_m1, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m2, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m3, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m4, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m5, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m6, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m7, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m8, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m9, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m10, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m11, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m12, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m13, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m14, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m15, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m16, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.serializeFrom(this->m_m17, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
return status;
}
Fw::SerializeStatus Format ::
deserializeFrom(
Fw::SerialBufferBase& buffer,
Fw::Endianness mode
)
{
Fw::SerializeStatus status;
status = buffer.deserializeTo(this->m_m1, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m2, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m3, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m4, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m5, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m6, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m7, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m8, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m9, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m10, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m11, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m12, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m13, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m14, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m15, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m16, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
status = buffer.deserializeTo(this->m_m17, mode);
if (status != Fw::FW_SERIALIZE_OK) {
return status;
}
return status;
}
FwSizeType Format ::
serializedSize() const
{
FwSizeType size = 0;
size += sizeof(I32);
size += sizeof(U32);
size += sizeof(I32);
size += sizeof(U32);
size += sizeof(I32);
size += sizeof(U32);
size += sizeof(I32);
size += sizeof(U32);
size += sizeof(I32);
size += sizeof(U32);
size += sizeof(F32);
size += sizeof(F32);
size += sizeof(F32);
size += sizeof(F32);
size += sizeof(F32);
size += sizeof(F32);
size += sizeof(F32);
return size;
}
#if FW_SERIALIZABLE_TO_STRING
void Format ::
toString(Fw::StringBase& sb) const
{
Fw::String tmp;
sb = "( ";
// Format m1
sb += "m1 = ";
tmp.format("%" PRIi32 "", this->m_m1);
sb += tmp;
sb += ", ";
// Format m2
sb += "m2 = ";
tmp.format("%" PRIu32 "", this->m_m2);
sb += tmp;
sb += ", ";
// Format m3
sb += "m3 = ";
tmp.format("%" PRIi32 "", this->m_m3);
sb += tmp;
sb += ", ";
// Format m4
sb += "m4 = ";
tmp.format("%" PRIu32 "", this->m_m4);
sb += tmp;
sb += ", ";
// Format m5
sb += "m5 = ";
tmp.format("%" PRIi32 "", this->m_m5);
sb += tmp;
sb += ", ";
// Format m6
sb += "m6 = ";
tmp.format("%" PRIu32 "", this->m_m6);
sb += tmp;
sb += ", ";
// Format m7
sb += "m7 = ";
tmp.format("%" PRIi32 "", this->m_m7);
sb += tmp;
sb += ", ";
// Format m8
sb += "m8 = ";
tmp.format("%" PRIu32 "", this->m_m8);
sb += tmp;
sb += ", ";
// Format m9
sb += "m9 = ";
tmp.format("%" PRIi32 "", this->m_m9);
sb += tmp;
sb += ", ";
// Format m10
sb += "m10 = ";
tmp.format("%" PRIu32 "", this->m_m10);
sb += tmp;
sb += ", ";
// Format m11
sb += "m11 = ";
tmp.format("%f", static_cast<F64>(this->m_m11));
sb += tmp;
sb += ", ";
// Format m12
sb += "m12 = ";
tmp.format("%f", static_cast<F64>(this->m_m12));
sb += tmp;
sb += ", ";
// Format m13
sb += "m13 = ";
tmp.format("%f", static_cast<F64>(this->m_m13));
sb += tmp;
sb += ", ";
// Format m14
sb += "m14 = ";
tmp.format("%f", static_cast<F64>(this->m_m14));
sb += tmp;
sb += ", ";
// Format m15
sb += "m15 = ";
tmp.format("%f", static_cast<F64>(this->m_m15));
sb += tmp;
sb += ", ";
// Format m16
sb += "m16 = ";
tmp.format("%f", static_cast<F64>(this->m_m16));
sb += tmp;
sb += ", ";
// Format m17
sb += "m17 = ";
tmp.format("%f", static_cast<F64>(this->m_m17));
sb += tmp;
sb += " )";
}
#endif
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
void Format ::
set(
I32 m1,
U32 m2,
I32 m3,
U32 m4,
I32 m5,
U32 m6,
I32 m7,
U32 m8,
I32 m9,
U32 m10,
F32 m11,
F32 m12,
F32 m13,
F32 m14,
F32 m15,
F32 m16,
F32 m17
)
{
this->m_m1 = m1;
this->m_m2 = m2;
this->m_m3 = m3;
this->m_m4 = m4;
this->m_m5 = m5;
this->m_m6 = m6;
this->m_m7 = m7;
this->m_m8 = m8;
this->m_m9 = m9;
this->m_m10 = m10;
this->m_m11 = m11;
this->m_m12 = m12;
this->m_m13 = m13;
this->m_m14 = m14;
this->m_m15 = m15;
this->m_m16 = m16;
this->m_m17 = m17;
}
void Format ::
set_m1(I32 m1)
{
this->m_m1 = m1;
}
void Format ::
set_m2(U32 m2)
{
this->m_m2 = m2;
}
void Format ::
set_m3(I32 m3)
{
this->m_m3 = m3;
}
void Format ::
set_m4(U32 m4)
{
this->m_m4 = m4;
}
void Format ::
set_m5(I32 m5)
{
this->m_m5 = m5;
}
void Format ::
set_m6(U32 m6)
{
this->m_m6 = m6;
}
void Format ::
set_m7(I32 m7)
{
this->m_m7 = m7;
}
void Format ::
set_m8(U32 m8)
{
this->m_m8 = m8;
}
void Format ::
set_m9(I32 m9)
{
this->m_m9 = m9;
}
void Format ::
set_m10(U32 m10)
{
this->m_m10 = m10;
}
void Format ::
set_m11(F32 m11)
{
this->m_m11 = m11;
}
void Format ::
set_m12(F32 m12)
{
this->m_m12 = m12;
}
void Format ::
set_m13(F32 m13)
{
this->m_m13 = m13;
}
void Format ::
set_m14(F32 m14)
{
this->m_m14 = m14;
}
void Format ::
set_m15(F32 m15)
{
this->m_m15 = m15;
}
void Format ::
set_m16(F32 m16)
{
this->m_m16 = m16;
}
void Format ::
set_m17(F32 m17)
{
this->m_m17 = m17;
}