mirror of
https://github.com/nasa/fpp.git
synced 2025-12-12 04:41:37 -06:00
145 lines
2.5 KiB
C++
Vendored
145 lines
2.5 KiB
C++
Vendored
// ======================================================================
|
|
// \title AbsSerializableAc.cpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief cpp file for Abs struct
|
|
// ======================================================================
|
|
|
|
#include "AbsSerializableAc.hpp"
|
|
#include "Fw/Types/Assert.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constructors
|
|
// ----------------------------------------------------------------------
|
|
|
|
Abs ::
|
|
Abs() :
|
|
Serializable(),
|
|
m_A()
|
|
{
|
|
|
|
}
|
|
|
|
Abs ::
|
|
Abs(const AbsType& A) :
|
|
Serializable(),
|
|
m_A(A)
|
|
{
|
|
|
|
}
|
|
|
|
Abs ::
|
|
Abs(const Abs& obj) :
|
|
Serializable(),
|
|
m_A(obj.m_A)
|
|
{
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Operators
|
|
// ----------------------------------------------------------------------
|
|
|
|
Abs& Abs ::
|
|
operator=(const Abs& obj)
|
|
{
|
|
if (this == &obj) {
|
|
return *this;
|
|
}
|
|
|
|
set(obj.m_A);
|
|
return *this;
|
|
}
|
|
|
|
bool Abs ::
|
|
operator==(const Abs& obj) const
|
|
{
|
|
return (this->m_A == obj.m_A);
|
|
}
|
|
|
|
bool Abs ::
|
|
operator!=(const Abs& obj) const
|
|
{
|
|
return !(*this == obj);
|
|
}
|
|
|
|
#ifdef BUILD_UT
|
|
|
|
std::ostream& operator<<(std::ostream& os, const Abs& obj) {
|
|
Fw::String s;
|
|
obj.toString(s);
|
|
os << s.toChar();
|
|
return os;
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Member functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::SerializeStatus Abs ::
|
|
serialize(Fw::SerializeBufferBase& buffer) const
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.serialize(this->m_A);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
Fw::SerializeStatus Abs ::
|
|
deserialize(Fw::SerializeBufferBase& buffer)
|
|
{
|
|
Fw::SerializeStatus status;
|
|
|
|
status = buffer.deserialize(this->m_A);
|
|
if (status != Fw::FW_SERIALIZE_OK) {
|
|
return status;
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
#if FW_SERIALIZABLE_TO_STRING
|
|
|
|
void Abs ::
|
|
toString(Fw::StringBase& sb) const
|
|
{
|
|
static const char* formatString =
|
|
"( "
|
|
"A = %s"
|
|
" )";
|
|
|
|
// Declare strings to hold any serializable toString() arguments
|
|
Fw::String AStr;
|
|
|
|
// Call toString for arrays and serializable types
|
|
this->m_A.toString(AStr);
|
|
|
|
sb.format(
|
|
formatString,
|
|
AStr.toChar()
|
|
);
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Setter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void Abs ::
|
|
set(const AbsType& A)
|
|
{
|
|
this->m_A = A;
|
|
}
|
|
|
|
void Abs ::
|
|
setA(const AbsType& A)
|
|
{
|
|
this->m_A = A;
|
|
}
|