fprime/Svc/GenericHub/GenericHubComponentImpl.hpp
M Starch ec08d43dd3
Removes NATIVE_INT_TYPE, NATIVE_UINT_TYPE, and POINTER_CAST from Fw (#3286)
* NATIVE_INT_TYPE use in toString

* NATIVE_INT_TYPE use in SimpleObjRegistry

* NATIVE_INT_TYPE use in Asserts

* NATIVE_INT_TYPE use in Fw/Comp

* NATIVE_INT_TYPE use in getCapacity

* NATIVE_INT_TYPE use in getEntries

* NATIVE_INT_TYPE use in size/length

* NATIVE_INT_TYPE use in FILE_NAME_ARG

* NATIVE_INT_TYPE use in Fw (misc)

* NATIVE_INT_TYPE use in identifier

* NATIVE_INT_TYPE use in Fw (misc II)

* POINTER_CAST in Buffer

* POINTER_CAST in Serializable

* sp

* Removing no longer used DefaultTypes.hpp

* Fixes to accomidate Fw refactor

* Unit-test and CI fixes

* Fixing review comments - pt 1
2025-03-04 14:42:48 -08:00

98 lines
3.5 KiB
C++

// ======================================================================
// \title GenericHubComponentImpl.hpp
// \author mstarch
// \brief hpp file for GenericHub component implementation class
//
// \copyright
// Copyright 2009-2015, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================
#ifndef GenericHub_HPP
#define GenericHub_HPP
#include "Svc/GenericHub/GenericHubComponentAc.hpp"
namespace Svc {
class GenericHubComponentImpl final : public GenericHubComponentBase {
public:
/**
* HubType:
*
* Type of serialized data on the wire. Allows for expanding them on the opposing end.
*/
enum HubType {
HUB_TYPE_PORT, //!< Port type transmission
HUB_TYPE_BUFFER, //!< Buffer type transmission
HUB_TYPE_EVENT, //!< Event transmission
HUB_TYPE_CHANNEL, //!< Telemetry channel type
HUB_TYPE_MAX
};
constexpr static FwSizeType GENERIC_HUB_DATA_SIZE = 1024;
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------
//! Construct object GenericHub
//!
GenericHubComponentImpl(const char* const compName /*!< The component name*/
);
//! Destroy object GenericHub
//!
~GenericHubComponentImpl();
PRIVATE:
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for buffersIn
//!
void buffersIn_handler(const FwIndexType portNum, /*!< The port number*/
Fw::Buffer& fwBuffer);
//! Handler implementation for dataIn
//!
void dataIn_handler(const FwIndexType portNum, /*!< The port number*/
Fw::Buffer& fwBuffer);
//! Handler implementation for LogRecv
//!
void LogRecv_handler(const FwIndexType portNum, /*!< The port number*/
FwEventIdType id, /*!< Log ID */
Fw::Time& timeTag, /*!< Time Tag */
const Fw::LogSeverity& severity, /*!< The severity argument */
Fw::LogBuffer& args /*!< Buffer containing serialized log entry */
);
//! Handler implementation for TlmRecv
//!
void TlmRecv_handler(const FwIndexType portNum, /*!< The port number*/
FwChanIdType id, /*!< Telemetry Channel ID */
Fw::Time& timeTag, /*!< Time Tag */
Fw::TlmBuffer& val /*!< Buffer containing serialized telemetry value */
);
// ----------------------------------------------------------------------
// Handler implementations for user-defined serial input ports
// ----------------------------------------------------------------------
//! Handler implementation for portIn
//!
void portIn_handler(FwIndexType portNum, /*!< The port number*/
Fw::SerializeBufferBase& Buffer /*!< The serialization buffer*/
);
// Helpers and members
void send_data(const HubType type, const FwIndexType port, const U8* data, const FwSizeType size);
};
} // end namespace Svc
#endif