diff --git a/source/RobotAPI/libraries/armem/server/query_proc/base/CoreSegmentQueryProcessorBase.h b/source/RobotAPI/libraries/armem/server/query_proc/base/CoreSegmentQueryProcessorBase.h index d334019c4ed70de05e56e6e0164a912741e0e772..9d7b2518227e4ddf0c5d759963af193656e39894 100644 --- a/source/RobotAPI/libraries/armem/server/query_proc/base/CoreSegmentQueryProcessorBase.h +++ b/source/RobotAPI/libraries/armem/server/query_proc/base/CoreSegmentQueryProcessorBase.h @@ -31,9 +31,9 @@ namespace armarx::armem::base::query_proc using EntitySnapshotT = typename EntityT::EntitySnapshotT; using Base::process; - void process(_CoreSegmentT& result, - const armem::query::data::CoreSegmentQuery& query, - const _CoreSegmentT& coreSegment) const override + virtual void process(_CoreSegmentT& result, + const armem::query::data::CoreSegmentQuery& query, + const _CoreSegmentT& coreSegment) const override { if (auto q = dynamic_cast<const armem::query::data::core::All*>(&query)) { diff --git a/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.cpp b/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.cpp index 692f15aed1831238ed26d77891bbd1047d30d8ba..bda9ad04de5ac7cd46be68a2f5f7ca2ec1419040 100644 --- a/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.cpp +++ b/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.cpp @@ -14,6 +14,14 @@ namespace armarx::armem::wm::query_proc CoreSegmentQueryProcessor::~CoreSegmentQueryProcessor() = default; + void CoreSegmentQueryProcessor::process( + CoreSegment& result, const armem::query::data::CoreSegmentQuery& query, const CoreSegment& coreSegment) const + { + std::scoped_lock lock(coreSegment.mutex()); + CoreSegmentQueryProcessorBase::process(result, query, coreSegment); + } + + data::CoreSegment CoreSegmentQueryProcessor::processToIce(const armem::query::data::CoreSegmentQuery& query, const wm::CoreSegment& coreSegment) const { data::CoreSegment data; diff --git a/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.h b/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.h index 8fc7e8a37a6130319529cd64310088cabc6bb2c3..f9e1d59c9f75866e3817440bb163ec5789c0f359 100644 --- a/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.h +++ b/source/RobotAPI/libraries/armem/server/query_proc/workingmemory/CoreSegmentQueryProcessor.h @@ -27,6 +27,10 @@ namespace armarx::armem::wm::query_proc using Base::process; + /// Locks the core segment, then delegates back to `CoreSegmentQueryProcessorBase`. + void process(CoreSegment& result, + const armem::query::data::CoreSegmentQuery& query, + const CoreSegment& coreSegment) const override; data::CoreSegment processToIce(const armem::query::data::CoreSegmentQuery& query, const wm::CoreSegment& coreSegment) const;