fpp/compiler/tools/fpp-to-cpp/test/array/S3SerializableAc.ref.hpp
2022-10-11 20:22:18 -07:00

177 lines
4.2 KiB
C++

// ======================================================================
// \title S3SerializableAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for S3 struct
// ======================================================================
#ifndef S_S3SerializableAc_HPP
#define S_S3SerializableAc_HPP
#include "FpConfig.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
namespace S {
//! A struct with a member array
class S3 :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! The array member types
typedef U32 Type_of_mU32Array[3];
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representation
SERIALIZED_SIZE =
sizeof(U32) * 3 +
sizeof(F64)
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
S3();
//! Member constructor
S3(
const Type_of_mU32Array& mU32Array,
F64 mF64
);
//! Copy constructor
S3(
const S3& obj //!< The source object
);
//! Member constructor (scalar values for arrays)
S3(
U32 mU32Array,
F64 mF64
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Copy assignment operator
S3& operator=(
const S3& obj //!< The source object
);
//! Equality operator
bool operator==(
const S3& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const S3& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const S3& 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 || BUILD_UT
//! Convert struct to string
void toString(
Fw::StringBase& sb //!< The StringBase object to hold the result
) const;
#endif
// ----------------------------------------------------------------------
// Getter functions
// ----------------------------------------------------------------------
//! Get member mU32Array
Type_of_mU32Array& getmU32Array()
{
return this->mU32Array;
}
//! Get member mU32Array (const)
const Type_of_mU32Array& getmU32Array() const
{
return this->mU32Array;
}
//! Get member mF64
F64 getmF64() const
{
return this->mF64;
}
// ----------------------------------------------------------------------
// Setter functions
// ----------------------------------------------------------------------
//! Set all members
void set(
const Type_of_mU32Array& mU32Array,
F64 mF64
);
//! Set member mU32Array
void setmU32Array(const Type_of_mU32Array& mU32Array);
//! Set member mF64
void setmF64(F64 mF64);
protected:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
U32 mU32Array[3];
F64 mF64;
};
}
#endif