13#ifndef RTCTK_REUSABLECOMPONENT_TELREPUB_TELREPUBBUSINESSLOGIC_HPP
14#define RTCTK_REUSABLECOMPONENT_TELREPUB_TELREPUBBUSINESSLOGIC_HPP
16#include <fastdds/dds/publisher/DataWriter.hpp>
20#include "numapp/numapolicies.hpp"
28#include <rad/logger.hpp>
29#include <rad/mal/utils.hpp>
35using namespace rtctk::componentFramework;
Alert Service interface.
Definition alertServiceIf.hpp:138
Component metrics interface.
Definition componentMetricsIf.hpp:164
Base interface for all Runtime Configuration Repository adapters.
Definition runtimeRepoIf.hpp:27
Container class that holds services of any type.
Definition serviceContainer.hpp:39
Processing MUDPI data received by UDP receiver: rtctk::telRepub::UdpReceiver.
Definition mudpiProcessor.hpp:56
DDS publisher thread class that supports (re)publishing of MUDPI samples.
Definition ddsPubThread.hpp:142
DDS publisher thread class that supports production and simulation mode.
Definition ddsPubThread.hpp:60
void CreateMudpiReceivers()
Creates MUDPI receivers (rtctk::telRepub::UdpReceiver) incl corresponding Publisher threads,...
Definition telRepubBusinessLogic.cpp:96
std::unique_ptr< DdsPub > m_dds_pub
Definition telRepubBusinessLogic.hpp:149
void ActivityEnabling(StopToken st) override
Definition telRepubBusinessLogic.cpp:507
void ActivityStarting(StopToken st) override
Definition telRepubBusinessLogic.cpp:496
void ActivityInitialising(StopToken st) override
Definition telRepubBusinessLogic.cpp:478
const std::string m_name
Component name.
Definition telRepubBusinessLogic.hpp:147
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition telRepubBusinessLogic.cpp:557
void ActivityGoingIdle(StopToken st) override
Definition telRepubBusinessLogic.cpp:516
PubThreadMudpi & CreatePubThread(const std::string &dds_topic_path_static)
Creates Publisher Thread (rtctk::telRepub::PubThread), reading configuration from the Runtime Configu...
Definition telRepubBusinessLogic.cpp:302
void Monitor()
Monitoring alerts etc that is executed in a loop.
Definition telRepubBusinessLogic.cpp:569
void DeleteMudpiReceivers()
Deletes UDPI receivers (rtctk::telRepub::UdpReceiver).
Definition telRepubBusinessLogic.cpp:230
AlertServiceIf & m_alerts
references to component alert service
Definition telRepubBusinessLogic.hpp:171
LifeCycle ComponentType
Definition telRepubBusinessLogic.hpp:56
TelRepubBusinessLogic(std::string name, ServiceContainer &service, RepubWranglerFactory &&factory=[](auto x) { return nullptr;})
Definition telRepubBusinessLogic.cpp:48
std::chrono::milliseconds m_monitor_report_interval_ms
Monitoring report interval in msecs.
Definition telRepubBusinessLogic.hpp:191
componentFramework::ComponentMetricsIf & m_metrics
references to component metrices service
Definition telRepubBusinessLogic.hpp:165
rtctk::componentFramework::ServiceContainer & m_service
Reference to container service.
Definition telRepubBusinessLogic.hpp:154
std::optional< numapp::NumaPolicies > monitoring_thread_policies
Monitoring thread policies.
Definition telRepubBusinessLogic.hpp:196
void ActivityRunning(StopToken st) override
Definition telRepubBusinessLogic.cpp:519
void ActivityRecovering(StopToken st) override
Definition telRepubBusinessLogic.cpp:504
RepubWranglerFactory m_wrangler_factory
Factory for wrangler functions, depending on the topic id.
Definition telRepubBusinessLogic.hpp:186
void ActionClearAlerts() override
Definition telRepubBusinessLogic.cpp:582
log4cplus::Logger & m_logger
Logger object reference of this class.
Definition telRepubBusinessLogic.hpp:142
virtual ~TelRepubBusinessLogic()
Definition telRepubBusinessLogic.cpp:61
std::vector< std::unique_ptr< UdpReceiver > > m_udp_receivers
vector of UDP receivers
Definition telRepubBusinessLogic.hpp:176
bool GuardUpdatingAllowed(const JsonPayload &args) override
Definition telRepubBusinessLogic.cpp:562
std::vector< std::unique_ptr< PubThread > > m_pub_threads
DDS publishers.
Definition telRepubBusinessLogic.hpp:181
void CreateSimPubThreads()
Creates all Simulated Publisher Threads (rtctk::telRepub::PubThread), reading configuration from the ...
Definition telRepubBusinessLogic.cpp:400
void ActivityGoingRunning(StopToken st) override
Definition telRepubBusinessLogic.cpp:513
componentFramework::RuntimeRepoIf & m_rtr
Reference to run-time repository needed to access the configuration.
Definition telRepubBusinessLogic.hpp:159
void ActivityDisabling(StopToken st) override
Definition telRepubBusinessLogic.cpp:510
void ReadGlobalCfg()
Reads Global configuration.
Definition telRepubBusinessLogic.cpp:67
void DeletePubThreads()
Deletes all (incl.
Definition telRepubBusinessLogic.cpp:474
void CreateDdsPubs()
Creates DDS publishers (rtctk::componentFramework::DdsPub), reading configuration from the Runtime Co...
Definition telRepubBusinessLogic.cpp:237
void DeleteDdsPubs()
Deletes DDS publishers (rtctk::componentFramework::DdsPub).
Definition telRepubBusinessLogic.cpp:289
Receiving UDP data asynchronously and forwards received packets to provided packet processors.
Definition udpReceiver.hpp:60
Header file for ComponentMetricsIf.
Logging Support Library based on log4cplus.
rad::StopToken StopToken
Definition stopToken.hpp:20
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
Definition ddsPubThread.cpp:17
Runnable< RtcComponent > LifeCycle
Definition telRepubBusinessLogic.hpp:37
std::function< std::error_code( const gsl::span< const gsl::span< const uint8_t > >, std::vector< uint8_t > &)> WranglerFunction
The wrangler function that is called with a span of spans containing the payload and an vector where ...
Definition wrangler.hpp:28
std::function< WranglerFunction(int32_t)> RepubWranglerFactory
Definition telRepubBusinessLogic.hpp:39
Wrangler: User extension point.
Lifecycle of a basic 'RtcComponent'.
Lifecycle Extension that makes an RTC Component 'Runnable'.
Header file for RuntimeRepoIf, which defines the API for RuntimeRepoAdapters.
Life cycle extension to make RtcComponent Runnable.
Definition runnable.hpp:31