// ====================================================================== // \title S2SerializableAc.cpp // \author Generated by fpp-to-cpp // \brief cpp file for S2 struct // ====================================================================== #include "Fw/Types/Assert.hpp" #include "S2SerializableAc.hpp" // ---------------------------------------------------------------------- // Constructors // ---------------------------------------------------------------------- S2 :: S2() : Serializable(), m_s1(0.0f, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, false, Fw::String("")) { } S2 :: S2(const M::S1& s1) : Serializable(), m_s1(s1) { } S2 :: S2(const S2& obj) : Serializable(), m_s1(obj.m_s1) { } // ---------------------------------------------------------------------- // Operators // ---------------------------------------------------------------------- S2& S2 :: operator=(const S2& obj) { if (this == &obj) { return *this; } set(obj.m_s1); return *this; } bool S2 :: operator==(const S2& obj) const { return (this->m_s1 == obj.m_s1); } bool S2 :: operator!=(const S2& obj) const { return !(*this == obj); } #ifdef BUILD_UT std::ostream& operator<<(std::ostream& os, const S2& obj) { Fw::String s; obj.toString(s); os << s.toChar(); return os; } #endif // ---------------------------------------------------------------------- // Member functions // ---------------------------------------------------------------------- Fw::SerializeStatus S2 :: serializeTo( Fw::LinearBufferBase& buffer, Fw::Endianness mode ) const { Fw::SerializeStatus status; status = buffer.serializeFrom(this->m_s1, mode); if (status != Fw::FW_SERIALIZE_OK) { return status; } return status; } Fw::SerializeStatus S2 :: deserializeFrom( Fw::LinearBufferBase& buffer, Fw::Endianness mode ) { Fw::SerializeStatus status; status = buffer.deserializeTo(this->m_s1, mode); if (status != Fw::FW_SERIALIZE_OK) { return status; } return status; } FwSizeType S2 :: serializedSize() const { FwSizeType size = 0; size += this->m_s1.serializedSize(); return size; } #if FW_SERIALIZABLE_TO_STRING void S2 :: toString(Fw::StringBase& sb) const { Fw::String tmp; sb = "( "; // Format s1 sb += "s1 = "; this->m_s1.toString(tmp); sb += tmp; sb += " )"; } #endif // ---------------------------------------------------------------------- // Setter functions // ---------------------------------------------------------------------- void S2 :: set(const M::S1& s1) { this->m_s1 = s1; } void S2 :: set_s1(const M::S1& s1) { this->m_s1 = s1; }