fpp/compiler/tools/fpp-to-cpp/test/port/KwdNamePortAc.ref.hpp
2025-12-05 17:00:59 -08:00

139 lines
3.4 KiB
C++
Vendored

// ======================================================================
// \title KwdNamePortAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for KwdName port
// ======================================================================
#ifndef KwdNamePortAc_HPP
#define KwdNamePortAc_HPP
#include "Fw/FPrimeBasicTypes.hpp"
#include "Fw/Types/String.hpp"
#if !FW_DIRECT_PORT_CALLS
#include "Fw/Comp/PassiveComponentBase.hpp"
#include "Fw/Port/InputPortBase.hpp"
#include "Fw/Port/OutputPortBase.hpp"
#include "Fw/Types/Serializable.hpp"
#endif
//! KwdName port constants
struct KwdNamePortConstants {
//! The size of the serial representations of the port arguments
static constexpr FwSizeType INPUT_SERIALIZED_SIZE =
sizeof(U32);
};
#if !FW_DIRECT_PORT_CALLS
//! Input KwdName port
//! A port with a keyword name
class InputKwdNamePort :
public Fw::InputPortBase
{
public:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
enum {
//! The size of the serial representations of the port arguments
SERIALIZED_SIZE = KwdNamePortConstants::INPUT_SERIALIZED_SIZE
};
public:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! The port callback function type
typedef void (*CompFuncPtr)(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum,
U32& time
);
public:
// ----------------------------------------------------------------------
// Input Port Member functions
// ----------------------------------------------------------------------
//! Constructor
InputKwdNamePort();
//! Initialization function
void init();
//! Register a component
void addCallComp(
Fw::PassiveComponentBase* callComp, //!< The containing component
CompFuncPtr funcPtr //!< The port callback function
);
//! Invoke a port interface
void invoke(U32& time);
private:
#if FW_PORT_SERIALIZATION == 1
//! Invoke the port with serialized arguments
Fw::SerializeStatus invokeSerial(Fw::LinearBufferBase& _buffer);
#endif
private:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
//! The pointer to the port callback function
CompFuncPtr m_func;
};
//! Output KwdName port
//! A port with a keyword name
class OutputKwdNamePort :
public Fw::OutputPortBase
{
public:
// ----------------------------------------------------------------------
// Output Port Member functions
// ----------------------------------------------------------------------
//! Constructor
OutputKwdNamePort();
//! Initialization function
void init();
//! Register an input port
void addCallPort(
InputKwdNamePort* callPort //!< The input port
);
//! Invoke a port interface
void invoke(U32& time) const;
private:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
//! The pointer to the input port
InputKwdNamePort* m_port;
};
#endif
#endif