summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-05-10 10:58:14 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-05-11 03:14:27 +0300
commita80db5a72391e8dba60c2dcf20397eb73b379574 (patch)
tree4574edb7c7ed251d188a5b20e41b062b5a2d6840 /src/ipa/raspberrypi/controller
parent2bbd1e4766c3cabf810bf06191ad9d747e278189 (diff)
ipa: raspberrypi: Add a Merge method to RPiController::Metadata
Add a new Merge method to the Metadata class. This will merge all unique key/value pairs from a source metadata map to the destination map. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller')
-rw-r--r--src/ipa/raspberrypi/controller/metadata.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp
index 3a97a5f5..fd6aac88 100644
--- a/src/ipa/raspberrypi/controller/metadata.hpp
+++ b/src/ipa/raspberrypi/controller/metadata.hpp
@@ -73,6 +73,12 @@ public:
return *this;
}
+ void Merge(Metadata &other)
+ {
+ std::scoped_lock lock(mutex_, other.mutex_);
+ data_.merge(other.data_);
+ }
+
template<typename T>
T *GetLocked(std::string const &tag)
{