mirror of
https://github.com/nasa/fpp.git
synced 2025-12-12 04:41:37 -06:00
145 lines
2.7 KiB
C++
145 lines
2.7 KiB
C++
// ======================================================================
|
|
// \title IncludingSerializableAc.cpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief cpp file for Including struct
|
|
// ======================================================================
|
|
|
|
#include "Fw/Types/Assert.hpp"
|
|
#include "IncludingSerializableAc.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constructors
|
|
// ----------------------------------------------------------------------
|
|
|
|
Including ::
|
|
Including() :
|
|
Serializable(),
|
|
m_x(0)
|
|
{
|
|
|
|
}
|
|
|
|
Including ::
|
|
Including(const Included& x) :
|
|
Serializable(),
|
|
m_x(x)
|
|
{
|
|
|
|
}
|
|
|
|
Including ::
|
|
Including(const Including& obj) :
|
|
Serializable(),
|
|
m_x(obj.m_x)
|
|
{
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Operators
|
|
// ----------------------------------------------------------------------
|
|
|
|
Including& Including ::
|
|
operator=(const Including& obj)
|
|
{
|
|
if (this == &obj) {
|
|
return *this;
|
|
}
|
|
|
|
set(obj.m_x);
|
|
return *this;
|
|
}
|
|
|
|
bool Including ::
|
|
operator==(const Including& obj) const
|
|
{
|
|
return (this->m_x == obj.m_x);
|
|
}
|
|
|
|
bool Including ::
|
|
operator!=(const Including& obj) const
|
|
{
|
|
return !(*this == obj);
|
|
}
|
|
|
|
#ifdef BUILD_UT
|
|
|
|
std::ostream& operator<<(std::ostream& os, const Including& obj) {
|
|
Fw::String s;
|
|
obj.toString(s);
|
|
os << s.toChar();
|
|
return os;
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Member functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::SerializeStatus Including ::
|
|
serialize(Fw::SerializeBufferBase& buffer) const
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.serialize(this->m_x);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
Fw::SerializeStatus Including ::
|
|
deserialize(Fw::SerializeBufferBase& buffer)
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.deserialize(this->m_x);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
#if FW_SERIALIZABLE_TO_STRING
|
|
|
|
void Including ::
|
|
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->m_x.toString(xStr);
|
|
|
|
sb.format(
|
|
formatString,
|
|
xStr.toChar()
|
|
);
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Setter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void Including ::
|
|
set(const Included& x)
|
|
{
|
|
this->m_x = x;
|
|
}
|
|
|
|
void Including ::
|
|
setx(const Included& x)
|
|
{
|
|
this->m_x = x;
|
|
}
|