Message ID | 20210510095814.3732400-6-naush@raspberrypi.com |
---|---|
State | Accepted |
Commit | a80db5a72391e8dba60c2dcf20397eb73b379574 |
Headers | show |
Series |
|
Related | show |
Hi Naush, Thank you for the patch. On Mon, May 10, 2021 at 10:58:14AM +0100, Naushir Patuck wrote: > 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> > --- > src/ipa/raspberrypi/controller/metadata.hpp | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp > index 3a97a5f5c502..fd6aac880bad 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) > {
diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp index 3a97a5f5c502..fd6aac880bad 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) {