fpp/compiler/tools/fpp-to-cpp/test/alias/CComponentAc.ref.hpp
2025-03-03 16:59:08 -08:00

197 lines
5.8 KiB
C++

// ======================================================================
// \title CComponentAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for C component base class
// ======================================================================
#ifndef CComponentAc_HPP
#define CComponentAc_HPP
#include "C_AArrayAc.hpp"
#include "C_T2AliasAc.hpp"
#include "C_TAliasAc.hpp"
#include "FpConfig.hpp"
#include "Fw/Comp/ActiveComponentBase.hpp"
#include "Fw/Port/InputSerializePort.hpp"
#include "Fw/Port/OutputSerializePort.hpp"
#include "Fw/Tlm/TlmString.hpp"
#include "TimePortAc.hpp"
#include "TlmPortAc.hpp"
//! \class CComponentBase
//! \brief Auto-generated base for C component
class CComponentBase :
public Fw::PassiveComponentBase
{
// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------
//! Friend class for white-box testing
friend class CComponentBaseFriend;
PROTECTED:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
//! Enumerations for numbers of special output ports
enum {
NUM_TIMEGET_OUTPUT_PORTS = 1,
NUM_TLMOUT_OUTPUT_PORTS = 1,
};
//! Channel IDs
enum {
CHANNELID_E1 = 0x0, //!< Channel ID for E1
CHANNELID_E2 = 0x1, //!< Channel ID for E2
};
public:
// ----------------------------------------------------------------------
// Component initialization
// ----------------------------------------------------------------------
//! Initialize CComponentBase object
void init(
FwEnumStoreType instance = 0 //!< The instance number
);
public:
// ----------------------------------------------------------------------
// Connect input ports to special output ports
// ----------------------------------------------------------------------
//! Connect port to timeGet[portNum]
void set_timeGet_OutputPort(
FwIndexType portNum, //!< The port number
Fw::InputTimePort* port //!< The input port
);
//! Connect port to tlmOut[portNum]
void set_tlmOut_OutputPort(
FwIndexType portNum, //!< The port number
Fw::InputTlmPort* port //!< The input port
);
#if FW_PORT_SERIALIZATION
public:
// ----------------------------------------------------------------------
// Connect serial input ports to special output ports
// ----------------------------------------------------------------------
//! Connect port to timeGet[portNum]
void set_timeGet_OutputPort(
FwIndexType portNum, //!< The port number
Fw::InputSerializePort* port //!< The port
);
//! Connect port to tlmOut[portNum]
void set_tlmOut_OutputPort(
FwIndexType portNum, //!< The port number
Fw::InputSerializePort* port //!< The port
);
#endif
PROTECTED:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct CComponentBase object
CComponentBase(
const char* compName = "" //!< The component name
);
//! Destroy CComponentBase object
virtual ~CComponentBase();
PROTECTED:
// ----------------------------------------------------------------------
// Getters for numbers of special output ports
// ----------------------------------------------------------------------
//! Get the number of timeGet output ports
//!
//! \return The number of timeGet output ports
FwIndexType getNum_timeGet_OutputPorts() const;
//! Get the number of tlmOut output ports
//!
//! \return The number of tlmOut output ports
FwIndexType getNum_tlmOut_OutputPorts() const;
PROTECTED:
// ----------------------------------------------------------------------
// Connection status queries for special output ports
// ----------------------------------------------------------------------
//! Check whether port timeGet is connected
//!
//! \return Whether port timeGet is connected
bool isConnected_timeGet_OutputPort(
FwIndexType portNum //!< The port number
);
//! Check whether port tlmOut is connected
//!
//! \return Whether port tlmOut is connected
bool isConnected_tlmOut_OutputPort(
FwIndexType portNum //!< The port number
);
PROTECTED:
// ----------------------------------------------------------------------
// Telemetry write functions
// ----------------------------------------------------------------------
//! Write telemetry channel E1
void tlmWrite_E1(
const C_T& arg, //!< The telemetry value
Fw::Time _tlmTime = Fw::Time() //!< Timestamp. Default: unspecified, request from getTime port
) const;
//! Write telemetry channel E2
void tlmWrite_E2(
const C_T2& arg, //!< The telemetry value
Fw::Time _tlmTime = Fw::Time() //!< Timestamp. Default: unspecified, request from getTime port
) const;
PROTECTED:
// ----------------------------------------------------------------------
// Time
// ----------------------------------------------------------------------
//! Get the time
//!
//! \\return The current time
Fw::Time getTime();
PRIVATE:
// ----------------------------------------------------------------------
// Special output ports
// ----------------------------------------------------------------------
//! Output port timeGet
Fw::OutputTimePort m_timeGet_OutputPort[NUM_TIMEGET_OUTPUT_PORTS];
//! Output port tlmOut
Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
};
#endif