fpp/compiler/tools/fpp-to-cpp/test/alias/BasicSerializableAc.ref.hpp
2025-10-10 18:00:24 -05:00

201 lines
4.7 KiB
C++
Vendored

// ======================================================================
// \title BasicSerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for Basic struct
// ======================================================================
#ifndef BasicSerializableAc_HPP
#define BasicSerializableAc_HPP
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "TF32AliasAc.hpp"
#include "TStringAliasAc.hpp"
#include "TStringSizeAliasAc.hpp"
#include "TU32AliasAc.hpp"
class Basic :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
sizeof(TU32) +
sizeof(TF32) +
Fw::StringBase::STATIC_SERIALIZED_SIZE(80) +
Fw::StringBase::STATIC_SERIALIZED_SIZE(2)
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
Basic();
//! Member constructor
Basic(
TU32 A,
TF32 B,
const Fw::StringBase& C,
const Fw::StringBase& D
);
//! Copy constructor
Basic(
const Basic& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
Basic& operator=(
const Basic& obj //!< The source object
);
//! Equality operator
bool operator==(
const Basic& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const Basic& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const Basic& obj //!< The object
);
#endif
public:
// ----------------------------------------------------------------------
// Member functions
// ----------------------------------------------------------------------
//! Serialization
Fw::SerializeStatus serializeTo(
Fw::SerializeBufferBase& buffer, //!< The serial buffer
Fw::Endianness mode = Fw::Endianness::BIG //!< Endianness of serialized buffer
) const;
//! Deserialization
Fw::SerializeStatus deserializeFrom(
Fw::SerializeBufferBase& 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 A
TU32 get_A() const
{
return this->m_A;
}
//! Get member B
TF32 get_B() const
{
return this->m_B;
}
//! Get member C
Fw::ExternalString& get_C()
{
return this->m_C;
}
//! Get member C (const)
const Fw::ExternalString& get_C() const
{
return this->m_C;
}
//! Get member D
Fw::ExternalString& get_D()
{
return this->m_D;
}
//! Get member D (const)
const Fw::ExternalString& get_D() const
{
return this->m_D;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(
TU32 A,
TF32 B,
const Fw::StringBase& C,
const Fw::StringBase& D
);
//! Set member A
void set_A(TU32 A);
//! Set member B
void set_B(TF32 B);
//! Set member C
void set_C(const Fw::StringBase& C);
//! Set member D
void set_D(const Fw::StringBase& D);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
TU32 m_A;
TF32 m_B;
char m___fprime_ac_C_buffer[Fw::StringBase::BUFFER_SIZE(80)];
Fw::ExternalString m_C;
char m___fprime_ac_D_buffer[Fw::StringBase::BUFFER_SIZE(2)];
Fw::ExternalString m_D;
};
#endif