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>
This commit is contained in:
Naushir Patuck 2021-05-10 10:58:14 +01:00 committed by Laurent Pinchart
parent 2bbd1e4766
commit a80db5a723

View file

@ -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)
{