12#ifndef RTCTK_REUSABLECOMPONENT_TELREPUB_DDS_PUB_THREAD_HPP
13#define RTCTK_REUSABLECOMPONENT_TELREPUB_DDS_PUB_THREAD_HPP
15#include "agnostictopicif.hpp"
19#include <fastdds/dds/publisher/DataWriter.hpp>
21#include <fmt/printf.h>
29#include <tbb/concurrent_queue.h>
31#include <numapp/thread.hpp>
72 const numapp::NumaPolicies& thread_policies,
73 std::uint32_t sample_id_increment);
182 void ProcessingLoop();
184 std::shared_ptr<Queue> m_frame_queue;
185 llnetio::mudpi::TopicId m_mudpi_topic_id;
209 const numapp::NumaPolicies& thread_policies,
210 std::uint32_t sample_id_increment,
225 void SimProcessingLoop();
227 AgnosticTopic m_sim_msg;
229 std::uint16_t m_sim_freq;
230 std::uint32_t m_sim_payload_size;
Models a single alert source that can be set or cleared.
Definition alertServiceIf.hpp:47
Component metrics interface.
Definition componentMetricsIf.hpp:85
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
bool Monitor() override
Definition ddsPubThread.cpp:159
MudpiProcessor & GetMudpiProcessor()
Get MudpiProcessor.
Definition ddsPubThread.cpp:151
std::shared_ptr< Queue > GetQueue()
Definition ddsPubThread.cpp:155
virtual ~PubThreadMudpi()
Joins publisher thread and prints some statistics information.
Definition ddsPubThread.cpp:139
void RunAsync() override
Enable publishing data.
Definition ddsPubThread.cpp:146
PubThreadMudpi(DataWriter &data_writer, componentFramework::ServiceContainer &service, CfgPubThreadMudpi &cfg, WranglerFunction &&wrangler)
Spawns publisher thread and sets up performance counters for monitoring.
Definition ddsPubThread.cpp:113
DDS publisher thread class that supports simulation mode.
Definition ddsPubThread.hpp:195
virtual ~PubThreadSim()
Joins publisher thread and prints some statistics information.
Definition ddsPubThread.cpp:269
PubThreadSim(DataWriter &data_writer, componentFramework::ServiceContainer &service, const numapp::NumaPolicies &thread_policies, std::uint32_t sample_id_increment, std::uint16_t sim_freq, std::uint32_t sim_payload_size)
Spawns publisher thread and sets up performance counters for monitoring.
Definition ddsPubThread.cpp:235
DDS publisher thread class that supports production and simulation mode.
Definition ddsPubThread.hpp:60
DataWriter & m_data_writer
Definition ddsPubThread.hpp:105
std::string m_thread_name
Definition ddsPubThread.hpp:103
perfc::ScopedRegistration m_pc_last_sample_id_published_reg
Definition ddsPubThread.hpp:128
componentFramework::AlertSource m_wrangler_alert
Definition ddsPubThread.hpp:114
virtual bool Monitor()
Definition ddsPubThread.cpp:108
std::string m_topic_name
Definition ddsPubThread.hpp:97
void IdleAsync()
Disable publishing data.
Definition ddsPubThread.cpp:97
std::string GetTopicName()
Definition ddsPubThread.cpp:104
virtual void RunAsync()
Enable publishing data.
Definition ddsPubThread.cpp:89
PubThread(DataWriter &data_writer, componentFramework::ServiceContainer &service, const numapp::NumaPolicies &thread_policies, std::uint32_t sample_id_increment)
Spawns publisher thread and sets up performance counters for monitoring.
Definition ddsPubThread.cpp:21
componentFramework::AlertSource m_topic_publish_alert
Alerts.
Definition ddsPubThread.hpp:112
State
Definition ddsPubThread.hpp:95
perfc::CounterI64 m_pc_published_samples
Diverse Performance counters.
Definition ddsPubThread.hpp:121
perfc::CounterI64 m_pc_last_sample_id_published
Definition ddsPubThread.hpp:127
perfc::ScopedRegistration m_pc_publication_errors_reg
Definition ddsPubThread.hpp:125
static std::atomic< std::uint16_t > s_count
Definition ddsPubThread.hpp:134
ComponentMetricsIf & m_metrics
Definition ddsPubThread.hpp:107
std::thread m_thread
Definition ddsPubThread.hpp:102
virtual ~PubThread()
Joins publisher thread and prints some statistics information.
Definition ddsPubThread.cpp:69
log4cplus::Logger m_logger
Definition ddsPubThread.hpp:99
std::atomic< State > m_requested_state
Definition ddsPubThread.hpp:101
perfc::CounterI64 m_pc_publication_errors
Definition ddsPubThread.hpp:124
perfc::ScopedRegistration m_pc_published_samples_reg
Definition ddsPubThread.hpp:122
std::unique_ptr< DurationMonitor<> > m_dur_mon
Definition ddsPubThread.hpp:130
std::uint32_t m_expected_sample_id_increment
Definition ddsPubThread.hpp:132
Header file for ComponentMetricsIf.
Declares some common DDS functionality.
Header file for Duration Monitor.
Logging Support Library based on log4cplus.
MUDPI processor: check and aggregate MUDPI payload to a single topic and put to the queue for publish...
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Definition ddsPubThread.cpp:17
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
Wrangler: User extension point.
Structure to hold MudpiProcessor's configuration.
Definition mudpiProcessor.hpp:40
Structure to hold PubThreadMudpi's configuration.
Definition ddsPubThread.hpp:51
std::uint32_t queue_size
Definition ddsPubThread.hpp:52
Structure to hold PubThread's configuration.
Definition ddsPubThread.hpp:44
numapp::NumaPolicies thread_policies
Definition ddsPubThread.hpp:45