11 #ifndef RTCTK_TELSUB_MAIN_HPP
12 #define RTCTK_TELSUB_MAIN_HPP
15 #include <memory_resource>
44 template <
class UserTopicType,
class DataBlender>
47 [blender = std::forward<DataBlender>(blender)](
48 std::string
const&
name,
55 auto op_logic_factory =
57 -> std::unique_ptr<OperationalLogicIf> {
62 size_t size = (params.dds_params.m_topics.size() + 1u) * (
72 std::unique_ptr<std::byte[]> mem(
new std::byte[size]);
75 auto resource = std::make_unique<std::pmr::monotonic_buffer_resource>(mem.get(), size);
81 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));
103 #endif // #ifndef RTCTK_TELSUB_MAIN_HPP