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

141 lines
3.5 KiB
C++
Vendored

// ======================================================================
// \title SDefaultSerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for SDefault struct
// ======================================================================
#ifndef SDefaultSerializableAc_HPP
#define SDefaultSerializableAc_HPP
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
//! Struct with a default value
class SDefault :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
sizeof(U32)
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
SDefault();
//! Member constructor
SDefault(U32 x);
//! Copy constructor
SDefault(
const SDefault& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
SDefault& operator=(
const SDefault& obj //!< The source object
);
//! Equality operator
bool operator==(
const SDefault& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const SDefault& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const SDefault& 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 x
U32 get_x() const
{
return this->m_x;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(U32 x);
//! Set member x
void set_x(U32 x);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
U32 m_x;
};
#endif