mirror of
https://github.com/nasa/fpp.git
synced 2025-12-12 04:41:37 -06:00
186 lines
4.7 KiB
C++
Vendored
186 lines
4.7 KiB
C++
Vendored
// ======================================================================
|
|
// \title StringArraySerializableAc.hpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief hpp file for StringArray struct
|
|
// ======================================================================
|
|
|
|
#ifndef StringArraySerializableAc_HPP
|
|
#define StringArraySerializableAc_HPP
|
|
|
|
#include "Fw/FPrimeBasicTypes.hpp"
|
|
#include "Fw/Types/ExternalString.hpp"
|
|
#include "Fw/Types/Serializable.hpp"
|
|
#include "Fw/Types/String.hpp"
|
|
|
|
class StringArray :
|
|
public Fw::Serializable
|
|
{
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Types
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! The type of s2
|
|
using Type_of_s2 = Fw::ExternalString[16];
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constants
|
|
// ----------------------------------------------------------------------
|
|
|
|
enum {
|
|
//! The size of the serial representation
|
|
SERIALIZED_SIZE =
|
|
Fw::StringBase::STATIC_SERIALIZED_SIZE(80) +
|
|
Fw::StringBase::STATIC_SERIALIZED_SIZE(40) * 16
|
|
};
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constructors
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Constructor (default value)
|
|
StringArray();
|
|
|
|
//! Member constructor
|
|
StringArray(
|
|
const Fw::StringBase& s1,
|
|
const Type_of_s2& s2
|
|
);
|
|
|
|
//! Copy constructor
|
|
StringArray(
|
|
const StringArray& obj //!< The source object
|
|
);
|
|
|
|
//! Member constructor (scalar values for arrays)
|
|
StringArray(
|
|
const Fw::StringBase& s1,
|
|
const Fw::StringBase& s2
|
|
);
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Operators
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Copy assignment operator
|
|
StringArray& operator=(
|
|
const StringArray& obj //!< The source object
|
|
);
|
|
|
|
//! Equality operator
|
|
bool operator==(
|
|
const StringArray& obj //!< The other object
|
|
) const;
|
|
|
|
//! Inequality operator
|
|
bool operator!=(
|
|
const StringArray& obj //!< The other object
|
|
) const;
|
|
|
|
#ifdef BUILD_UT
|
|
|
|
//! Ostream operator
|
|
friend std::ostream& operator<<(
|
|
std::ostream& os, //!< The ostream
|
|
const StringArray& 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 s1
|
|
Fw::ExternalString& get_s1()
|
|
{
|
|
return this->m_s1;
|
|
}
|
|
|
|
//! Get member s1 (const)
|
|
const Fw::ExternalString& get_s1() const
|
|
{
|
|
return this->m_s1;
|
|
}
|
|
|
|
//! Get member s2
|
|
Type_of_s2& get_s2()
|
|
{
|
|
return this->m_s2;
|
|
}
|
|
|
|
//! Get member s2 (const)
|
|
const Type_of_s2& get_s2() const
|
|
{
|
|
return this->m_s2;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Setter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Set all members
|
|
void set(
|
|
const Fw::StringBase& s1,
|
|
const Type_of_s2& s2
|
|
);
|
|
|
|
//! Set member s1
|
|
void set_s1(const Fw::StringBase& s1);
|
|
|
|
//! Set member s2
|
|
void set_s2(const Type_of_s2& 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[16][Fw::StringBase::BUFFER_SIZE(40)];
|
|
Fw::ExternalString m_s2[16];
|
|
|
|
};
|
|
|
|
#endif
|