fpp/compiler/tools/fpp-to-cpp/test/array/HeaderPathArrayAc.ref.hpp
Rob Bocchino 71163724f8 Revise array code gen
Add initializer list constructor
2025-08-19 13:31:14 -07:00

179 lines
4.5 KiB
C++
Vendored

// ======================================================================
// \title HeaderPathArrayAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for HeaderPath array
// ======================================================================
#ifndef HeaderPathArrayAc_HPP
#define HeaderPathArrayAc_HPP
#include <initializer_list>
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "include/T.hpp"
//! Test the include header path of an abstract type
class HeaderPath :
public Fw::Serializable
{
public:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! The element type
using ElementType = T;
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the array
SIZE = 3,
//! The serialized size of each element
ELEMENT_SERIALIZED_SIZE = T::SERIALIZED_SIZE,
//! The size of the serial representation
SERIALIZED_SIZE = SIZE * ELEMENT_SERIALIZED_SIZE
};
public:
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
//! Constructor (default value)
HeaderPath();
//! Constructor (primitive array)
HeaderPath(
const ElementType (&a)[SIZE] //!< The array
);
//! Constructor (single element)
HeaderPath(
const ElementType& e //!< The element
);
//! Constructor (initializer list)
HeaderPath(
const std::initializer_list<ElementType>& il //!< The initializer list
);
//! Constructor (multiple elements)
HeaderPath(
const ElementType& e1, //!< Element 1
const ElementType& e2, //!< Element 2
const ElementType& e3 //!< Element 3
);
//! Copy constructor
HeaderPath(
const HeaderPath& obj //!< The source object
);
public:
// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
//! Subscript operator
ElementType& operator[](
const FwSizeType i //!< The subscript index
);
//! Const subscript operator
const ElementType& operator[](
const FwSizeType i //!< The subscript index
) const;
//! Copy assignment operator (object)
HeaderPath& operator=(
const HeaderPath& obj //!< The source object
);
//! Copy assignment operator (primitive array)
HeaderPath& operator=(
const ElementType (&a)[SIZE] //!< The source array
);
//! Copy assignment operator (initializer list)
HeaderPath& operator=(
const std::initializer_list<ElementType>& il //!< The initializer list
);
//! Copy assignment operator (single element)
HeaderPath& operator=(
const ElementType& e //!< The element
);
//! Equality operator
bool operator==(
const HeaderPath& obj //!< The other object
) const;
//! Inequality operator
bool operator!=(
const HeaderPath& obj //!< The other object
) const;
#ifdef BUILD_UT
//! Ostream operator
friend std::ostream& operator<<(
std::ostream& os, //!< The ostream
const HeaderPath& obj //!< The object
);
#endif
public:
// ----------------------------------------------------------------------
// Public member functions
// ----------------------------------------------------------------------
//! Serialization
Fw::SerializeStatus serializeTo(
Fw::SerializeBufferBase& buffer //!< The serial buffer
) const;
//! Deserialization
Fw::SerializeStatus deserializeFrom(
Fw::SerializeBufferBase& buffer //!< The serial buffer
);
//! Get the dynamic serialized size of the array
FwSizeType serializedSize() const;
#if FW_SERIALIZABLE_TO_STRING
//! Convert array to string
void toString(
Fw::StringBase& sb //!< The StringBase object to hold the result
) const;
#endif
private:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
//! The array elements
ElementType elements[SIZE];
};
#endif