fpp/compiler/tools/fpp-to-cpp/test/component/base/SSerializableAc.ref.hpp
2024-06-20 08:22:22 -07:00

160 lines
3.6 KiB
C++

// ======================================================================
// \title SSerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for S struct
// ======================================================================
#ifndef SSerializableAc_HPP
#define SSerializableAc_HPP
#include "FpConfig.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
//! A struct
class S :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
sizeof(U32) +
Fw::StringBase::STATIC_SERIALIZED_SIZE(80)
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
S();
//! Member constructor
S(
U32 x,
const Fw::StringBase& y
);
//! Copy constructor
S(
const S& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
S& operator=(
const S& obj //!< The source object
);
//! Equality operator
bool operator==(
const S& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const S& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const S& obj //!< The object
);
#endif
public:
// ----------------------------------------------------------------------
// Member functions
// ----------------------------------------------------------------------
//! Serialization
Fw::SerializeStatus serialize(
Fw::SerializeBufferBase& buffer //!< The serial buffer
) const;
//! Deserialization
Fw::SerializeStatus deserialize(
Fw::SerializeBufferBase& buffer //!< The serial buffer
);
#if FW_SERIALIZABLE_TO_STRING
//! Convert struct to string
void toString(
Fw::StringBase& sb //!< The StringBase object to hold the result
) const;
#endif
// ----------------------------------------------------------------------
// Getter functions
// ----------------------------------------------------------------------
//! Get member x
U32 getx() const
{
return this->m_x;
}
//! Get member y
Fw::ExternalString& gety()
{
return this->m_y;
}
//! Get member y (const)
const Fw::ExternalString& gety() const
{
return this->m_y;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(
U32 x,
const Fw::StringBase& y
);
//! Set member x
void setx(U32 x);
//! Set member y
void sety(const Fw::StringBase& y);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
U32 m_x;
char m___fprime_ac_y_buffer[Fw::StringBase::BUFFER_SIZE(80)];
Fw::ExternalString m_y;
};
#endif