49 [blender = std::forward<DataBlender>(blender)](
50 const std::string& name,
57 auto op_logic_factory =
59 -> std::unique_ptr<OperationalLogicIf> {
64 size_t size = (params.dds_params.m_topics.size() + 1u) * (
74 std::unique_ptr<std::byte[]> mem = std::make_unique_for_overwrite<std::byte[]>(size);
77 auto resource = std::make_unique<std::pmr::monotonic_buffer_resource>(mem.get(), size);
82 auto dds_subscriber = std::make_unique<DdsWaitSet>(params.dds_params, resource.get());
83 auto correlator = std::make_unique<Correlator>(
84 params.correlator_params, std::move(dds_subscriber), metrics, resource.get());
86 auto writer = ipcq::Writer<UserTopicType>(params.shm_params.topic_name.c_str(),
87 params.shm_params.capacity,
88 params.shm_params.mem_policy);
90 return std::make_unique<OperationalLogic>(params.operational_params,
91 std::move(correlator),
92 std::move(shm_publisher),
97 }
catch (boost::interprocess::interprocess_exception& e) {
98 throw CII_MAKE_EXCEPTION_WITH_NESTED(
101 fmt::format(
"Failed to create SHM queue {}, does it already exist?",
102 params.shm_params.topic_name.c_str()));
106 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:73
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:58
Provides core functionality of an RTC Component.