mirror of
https://github.com/nasa/fpp.git
synced 2025-12-13 00:06:20 -06:00
153 lines
2.8 KiB
C++
153 lines
2.8 KiB
C++
// ======================================================================
|
|
// \title Modules3SerializableAc.cpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief cpp file for Modules3 struct
|
|
// ======================================================================
|
|
|
|
#include "cstdio"
|
|
#include "cstring"
|
|
|
|
#include "Fw/Types/Assert.hpp"
|
|
#include "Fw/Types/StringUtils.hpp"
|
|
#include "Modules3SerializableAc.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constructors
|
|
// ----------------------------------------------------------------------
|
|
|
|
Modules3 ::
|
|
Modules3() :
|
|
Serializable(),
|
|
x(0, 0.0f)
|
|
{
|
|
|
|
}
|
|
|
|
Modules3 ::
|
|
Modules3(const M::Modules1& x) :
|
|
Serializable(),
|
|
x(x)
|
|
{
|
|
|
|
}
|
|
|
|
Modules3 ::
|
|
Modules3(const Modules3& obj) :
|
|
Serializable(),
|
|
x(obj.x)
|
|
{
|
|
|
|
}
|
|
|
|
Modules3& Modules3 ::
|
|
operator=(const Modules3& obj)
|
|
{
|
|
if (this == &obj) {
|
|
return *this;
|
|
}
|
|
|
|
set(obj.x);
|
|
return *this;
|
|
}
|
|
|
|
bool Modules3 ::
|
|
operator==(const Modules3& obj) const
|
|
{
|
|
return (
|
|
(this->x == obj.x)
|
|
);
|
|
}
|
|
|
|
bool Modules3 ::
|
|
operator!=(const Modules3& obj) const
|
|
{
|
|
return !(*this == obj);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Member functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::SerializeStatus Modules3 ::
|
|
serialize(Fw::SerializeBufferBase& buffer) const
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.serialize(this->x);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
Fw::SerializeStatus Modules3 ::
|
|
deserialize(Fw::SerializeBufferBase& buffer)
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.deserialize(this->x);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
#if FW_SERIALIZABLE_TO_STRING || BUILD_UT
|
|
|
|
void Modules3 ::
|
|
toString(Fw::StringBase& sb) const
|
|
{
|
|
static const char* formatString =
|
|
"( "
|
|
"x = %s"
|
|
" )";
|
|
|
|
// Declare strings to hold any serializable toString() arguments
|
|
Fw::String xStr;
|
|
|
|
// Call toString for arrays and serializable types
|
|
this->x.toString(xStr);
|
|
|
|
char outputString[FW_ARRAY_TO_STRING_BUFFER_SIZE];
|
|
(void) snprintf(
|
|
outputString,
|
|
FW_ARRAY_TO_STRING_BUFFER_SIZE,
|
|
formatString,
|
|
xStr.toChar()
|
|
);
|
|
|
|
outputString[FW_ARRAY_TO_STRING_BUFFER_SIZE-1] = 0; // NULL terminate
|
|
sb = outputString;
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
const M::Modules1& Modules3 ::
|
|
getx() const
|
|
{
|
|
return this->x;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Setter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void Modules3 ::
|
|
set(const M::Modules1& x)
|
|
{
|
|
this->x = x;
|
|
|
|
}
|
|
|
|
void Modules3 ::
|
|
setx(const M::Modules1& x)
|
|
{
|
|
this->x = x;
|
|
}
|