fpp/compiler/tools/fpp-to-cpp/test/struct/StringSerializableAc.ref.hpp
2024-06-20 08:22:22 -07:00

166 lines
4.0 KiB
C++

// ======================================================================
// \title StringSerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for String struct
// ======================================================================
#ifndef StringSerializableAc_HPP
#define StringSerializableAc_HPP
#include "FpConfig.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
class String :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
Fw::StringBase::STATIC_SERIALIZED_SIZE(80) +
Fw::StringBase::STATIC_SERIALIZED_SIZE(40)
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
String();
//! Member constructor
String(
const Fw::StringBase& s1,
const Fw::StringBase& s2
);
//! Copy constructor
String(
const String& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
String& operator=(
const String& obj //!< The source object
);
//! Equality operator
bool operator==(
const String& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const String& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const String& 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 s1
Fw::ExternalString& gets1()
{
return this->m_s1;
}
//! Get member s1 (const)
const Fw::ExternalString& gets1() const
{
return this->m_s1;
}
//! Get member s2
Fw::ExternalString& gets2()
{
return this->m_s2;
}
//! Get member s2 (const)
const Fw::ExternalString& gets2() const
{
return this->m_s2;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(
const Fw::StringBase& s1,
const Fw::StringBase& s2
);
//! Set member s1
void sets1(const Fw::StringBase& s1);
//! Set member s2
void sets2(const Fw::StringBase& s2);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
char m___fprime_ac_s1_buffer[Fw::StringBase::BUFFER_SIZE(80)];
Fw::ExternalString m_s1;
char m___fprime_ac_s2_buffer[Fw::StringBase::BUFFER_SIZE(40)];
Fw::ExternalString m_s2;
};
#endif