50 [blender = std::forward<DataBlender>(blender)](
51 const std::string& name,
58 auto op_logic_factory =
60 -> std::unique_ptr<OperationalLogicIf> {
65 size_t size = (params.dds_params.m_topics.size() + 1u) * (
75 std::unique_ptr<std::byte[]> mem = std::make_unique_for_overwrite<std::byte[]>(size);
78 auto resource = std::make_unique<std::pmr::monotonic_buffer_resource>(mem.get(), size);
83 auto dds_subscriber = std::make_unique<DdsWaitSet>(params.dds_params, resource.get());
84 auto correlator = std::make_unique<Correlator>(
85 params.correlator_params, std::move(dds_subscriber), metrics, resource.get());
87 auto writer = ipcq::Writer<UserTopicType>(params.shm_params.topic_name.c_str(),
88 params.shm_params.capacity,
89 params.shm_params.mem_policy);
91 return std::make_unique<OperationalLogic>(params.operational_params,
92 std::move(correlator),
93 std::move(shm_publisher),
98 }
catch (boost::interprocess::interprocess_exception& e) {
99 throw CII_MAKE_EXCEPTION_WITH_NESTED(
102 fmt::format(
"Failed to create SHM queue {}, does it already exist?",
103 params.shm_params.topic_name.c_str()));
107 return std::make_unique<BusinessLogic>(name, services, std::move(op_logic_factory));
void RunAsRtcComponent(const Args &args, BLF factory)
RTC Component runner function, needed to run custom BusinessLogic as RTC Component.
Definition rtcComponentMain.hpp:74
auto MakeShmPublisher(ShmWriter &&shm_writer, DataBlender &blender) -> std::unique_ptr< ShmPublisher< UserTopicType, DataBlender, ShmWriter > >
Helper that can deduce DataBlender class template argument.
Definition shmPublisher.hpp:59
Provides core functionality of an RTC Component.