mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-15 16:35:06 +03:00
ipa: raspberrypi: Add RPiController::Metadata::mergeCopy
Add a new member function to RPiController::Metadata that copies unique key/value pairs from one object to the other. This is different from std::map::merge that would remove the key/value pairs from the source object. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
33abc2b31e
commit
087f0c3c42
1 changed files with 10 additions and 0 deletions
|
@ -80,6 +80,16 @@ public:
|
||||||
data_.merge(other.data_);
|
data_.merge(other.data_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mergeCopy(const Metadata &other)
|
||||||
|
{
|
||||||
|
std::scoped_lock lock(mutex_, other.mutex_);
|
||||||
|
/*
|
||||||
|
* If the metadata key exists, ignore this item and copy only
|
||||||
|
* unique key/value pairs.
|
||||||
|
*/
|
||||||
|
data_.insert(other.data_.begin(), other.data_.end());
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T *getLocked(std::string const &tag)
|
T *getLocked(std::string const &tag)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue