// ====================================================================== // \title NamespaceSerializableAc.cpp // \author Generated by fpp-to-cpp // \brief cpp file for Namespace struct // ====================================================================== #include "Fw/Types/Assert.hpp" #include "NamespaceSerializableAc.hpp" // ---------------------------------------------------------------------- // Constructors // ---------------------------------------------------------------------- Namespace :: Namespace() : Serializable(), m_A(0), m_B(0), m_C(0), m_D(0) { } Namespace :: Namespace( SimpleCType A, SimpleCType2 B, M::M2::NamespacedAliasType C, M::NamespacedAliasType2 D ) : Serializable(), m_A(A), m_B(B), m_C(C), m_D(D) { } Namespace :: Namespace(const Namespace& obj) : Serializable(), m_A(obj.m_A), m_B(obj.m_B), m_C(obj.m_C), m_D(obj.m_D) { } // ---------------------------------------------------------------------- // Operators // ---------------------------------------------------------------------- Namespace& Namespace :: operator=(const Namespace& obj) { if (this == &obj) { return *this; } set(obj.m_A, obj.m_B, obj.m_C, obj.m_D); return *this; } bool Namespace :: operator==(const Namespace& obj) const { if (this == &obj) { return true; } return ( (this->m_A == obj.m_A) && (this->m_B == obj.m_B) && (this->m_C == obj.m_C) && (this->m_D == obj.m_D) ); } bool Namespace :: operator!=(const Namespace& obj) const { return !(*this == obj); } #ifdef BUILD_UT std::ostream& operator<<(std::ostream& os, const Namespace& obj) { Fw::String s; obj.toString(s); os << s.toChar(); return os; } #endif // ---------------------------------------------------------------------- // Member functions // ---------------------------------------------------------------------- Fw::SerializeStatus Namespace :: serialize(Fw::SerializeBufferBase& buffer) const { Fw::SerializeStatus status; status = buffer.serialize(this->m_A); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.serialize(this->m_B); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.serialize(this->m_C); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.serialize(this->m_D); if (status != Fw::FW_SERIALIZE_OK) { return status; } return status; } Fw::SerializeStatus Namespace :: deserialize(Fw::SerializeBufferBase& buffer) { Fw::SerializeStatus status; status = buffer.deserialize(this->m_A); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.deserialize(this->m_B); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.deserialize(this->m_C); if (status != Fw::FW_SERIALIZE_OK) { return status; } status = buffer.deserialize(this->m_D); if (status != Fw::FW_SERIALIZE_OK) { return status; } return status; } #if FW_SERIALIZABLE_TO_STRING void Namespace :: toString(Fw::StringBase& sb) const { static const char* formatString = "( " "A = %s, " "B = %s, " "C = %s, " "D = %s" " )"; sb.format( formatString, this->m_A, this->m_B, this->m_C, this->m_D ); } #endif // ---------------------------------------------------------------------- // Setter functions // ---------------------------------------------------------------------- void Namespace :: set( SimpleCType A, SimpleCType2 B, M::M2::NamespacedAliasType C, M::NamespacedAliasType2 D ) { this->m_A = A; this->m_B = B; this->m_C = C; this->m_D = D; } void Namespace :: setA(SimpleCType A) { this->m_A = A; } void Namespace :: setB(SimpleCType2 B) { this->m_B = B; } void Namespace :: setC(M::M2::NamespacedAliasType C) { this->m_C = C; } void Namespace :: setD(M::NamespacedAliasType2 D) { this->m_D = D; }