fpp/compiler/tools/fpp-to-cpp/test/array/SWrapperSerializableAc.ref.hpp
2025-11-16 13:49:34 -08:00

148 lines
3.7 KiB
C++
Vendored

// ======================================================================
// \title SWrapperSerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for SWrapper struct
// ======================================================================
#ifndef SWrapperSerializableAc_HPP
#define SWrapperSerializableAc_HPP
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "SDefaultSerializableAc.hpp"
//! Struct wrapping a struct with a default field
class SWrapper :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
SDefault::SERIALIZED_SIZE
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
SWrapper();
//! Member constructor
SWrapper(const SDefault& s);
//! Copy constructor
SWrapper(
const SWrapper& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
SWrapper& operator=(
const SWrapper& obj //!< The source object
);
//! Equality operator
bool operator==(
const SWrapper& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const SWrapper& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const SWrapper& obj //!< The object
);
#endif
public:
// ----------------------------------------------------------------------
// Member functions
// ----------------------------------------------------------------------
//! Serialization
Fw::SerializeStatus serializeTo(
Fw::SerialBufferBase& buffer, //!< The serial buffer
Fw::Endianness mode = Fw::Endianness::BIG //!< Endianness of serialized buffer
) const;
//! Deserialization
Fw::SerializeStatus deserializeFrom(
Fw::SerialBufferBase& buffer, //!< The serial buffer
Fw::Endianness mode = Fw::Endianness::BIG //!< Endianness of serialized buffer
);
//! Get the dynamic serialized size of the struct
FwSizeType serializedSize() const;
#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 s
SDefault& get_s()
{
return this->m_s;
}
//! Get member s (const)
const SDefault& get_s() const
{
return this->m_s;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(const SDefault& s);
//! Set member s
void set_s(const SDefault& s);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
SDefault m_s;
};
#endif