// ====================================================================== // \title SingleElementArrayAc.hpp // \author Generated by fpp-to-cpp // \brief hpp file for SingleElement array // ====================================================================== #ifndef SingleElementArrayAc_HPP #define SingleElementArrayAc_HPP #include "FpConfig.hpp" #include "Fw/Types/Serializable.hpp" #include "Fw/Types/String.hpp" //! An array with one element class SingleElement : public Fw::Serializable { public: // ---------------------------------------------------------------------- // Types // ---------------------------------------------------------------------- //! The element type typedef U32 ElementType; public: // ---------------------------------------------------------------------- // Constants // ---------------------------------------------------------------------- enum { //! The size of the array SIZE = 1, //! The size of the serial representation SERIALIZED_SIZE = SIZE * sizeof(U32), }; public: // ---------------------------------------------------------------------- // Constructors // ---------------------------------------------------------------------- //! Constructor (default value) SingleElement(); //! Constructor (user-provided value) SingleElement( const ElementType (&a)[SIZE] //!< The array ); //! Constructor (multiple elements) SingleElement( const ElementType& e1 //!< Element 1 ); //! Copy Constructor SingleElement( const SingleElement& obj //!< The source object ); public: // ---------------------------------------------------------------------- // Operators // ---------------------------------------------------------------------- //! Subscript operator ElementType& operator[]( const U32 i //!< The subscript index ); //! Const subscript operator const ElementType& operator[]( const U32 i //!< The subscript index ) const; //! Copy assignment operator (object) SingleElement& operator=( const SingleElement& obj //!< The source object ); //! Copy assignment operator (raw array) SingleElement& operator=( const ElementType (&a)[SIZE] //!< The source array ); //! Copy assignment operator (single element) SingleElement& operator=( const ElementType& e //!< The element ); //! Equality operator bool operator==( const SingleElement& obj //!< The other object ) const; //! Inequality operator bool operator!=( const SingleElement& obj //!< The other object ) const; #ifdef BUILD_UT //! Ostream operator friend std::ostream& operator<<( std::ostream& os, //!< The ostream const SingleElement& 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_ARRAY_TO_STRING || BUILD_UT //! 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