12#ifndef RTCTK_TELSUB_MAIN_HPP
13#define RTCTK_TELSUB_MAIN_HPP
16#include <memory_resource>
45template <
class UserTopicType,
class DataBlender>
48 [blender = std::forward<DataBlender>(blender)](
49 std::string
const& name,
56 auto op_logic_factory =
58 -> std::unique_ptr<OperationalLogicIf> {
63 size_t size = (params.dds_params.m_topics.size() + 1u) * (
73 std::unique_ptr<std::byte[]> mem(
new std::byte[size]);
76 auto resource = std::make_unique<std::pmr::monotonic_buffer_resource>(mem.get(), size);
81 auto dds_subscriber = std::make_unique<DdsWaitSet>(params.dds_params, resource.get());
82 auto correlator = std::make_unique<Correlator>(
83 params.correlator_params, std::move(dds_subscriber), resource.get());
84 auto writer = ipcq::Writer<UserTopicType>(params.shm_params.topic_name.c_str(),
85 params.shm_params.capacity,
86 params.shm_params.mem_policy);
87 auto shm_publisher = MakeShmPublisher<UserTopicType>(std::move(writer), blender);
88 return std::make_unique<OperationalLogic>(params.operational_params,
89 std::move(correlator),
90 std::move(shm_publisher),
97 return std::make_unique<BusinessLogic>(name, services, std::move(op_logic_factory));
99 componentFramework::RunAsRtcComponent<BusinessLogic>(args, std::move(factory));
Alert Service interface.
Definition: alertServiceIf.hpp:315
Class used to parse default command line arguments.
Definition: rtcComponentArgs.hpp:34
Component metrics interface.
Definition: componentMetricsIf.hpp:184
Container class that holds services of any type.
Definition: serviceContainer.hpp:39
Declares the DdsWaitSet implementation.
int Main(int argc, char *argv[])
Main function implementation.
Definition: rtcComponentMain.hpp:229
rtctk::componentFramework::SampleInfoSeq DdsInfoSeq
Definition: agnosticDataSamples.hpp:30
rtctk::componentFramework::AgnosticTopicSeq DdsSampleSeq
Definition: agnosticDataSamples.hpp:28
Implements the business logic for telSub.
Provides core functionality of an RTC Component.
Agnostic data sample non-owning reference type.
Definition: dataSampleView.hpp:26
Set of all parameters needed when constructing the OperationalLogic object.
Definition: businessLogic.hpp:47