From a80db5a72391e8dba60c2dcf20397eb73b379574 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 10 May 2021 10:58:14 +0100 Subject: 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 Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/metadata.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ipa') 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 T *GetLocked(std::string const &tag) { -- cgit v1.2.1