<div dir="ltr"><div dir="ltr">Hi Laurent,<div><br></div><div>Thank you for your feedback.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 16 Apr 2021 at 17:43, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Naush,<br>
<br>
Thank you for the patch.<br>
<br>
On Fri, Apr 16, 2021 at 11:31:40AM +0100, Naushir Patuck wrote:<br>
> Add the move operator implementation for the RPiController::Metadata<br>
> class.<br>
> <br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
>  src/ipa/raspberrypi/controller/metadata.hpp | 8 ++++++++<br>
>  1 file changed, 8 insertions(+)<br>
> <br>
> diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp<br>
> index 4f44ffc6771c..c55194040f2f 100644<br>
> --- a/src/ipa/raspberrypi/controller/metadata.hpp<br>
> +++ b/src/ipa/raspberrypi/controller/metadata.hpp<br>
> @@ -45,6 +45,14 @@ public:<br>
>               data_ = other.data_;<br>
>               return *this;<br>
>       }<br>
> +     Metadata &operator=(Metadata &&other)<br>
> +     {<br>
> +             std::lock_guard<std::mutex> lock(mutex_);<br>
> +             std::lock_guard<std::mutex> other_lock(other.mutex_);<br>
> +             data_ = std::move(other.data_);<br>
> +             other.data_.clear();<br>
> +             return *this;<br>
> +     }<br>
<br>
<a href="https://en.cppreference.com/w/cpp/language/rule_of_three" rel="noreferrer" target="_blank">https://en.cppreference.com/w/cpp/language/rule_of_three</a> says you should<br>
also implement the copy and move constructors.<br></blockquote><div><br></div><div>Indeed! I'll add the copy and move constructors in the next revision.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I'm a bit concerned by the locks, but that's a separate question.<br></blockquote><div><br></div><div>Fire away :-)</div><div><br></div><div>Regards,</div><div>Naush</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
>       template<typename T> T *GetLocked(std::string const &tag)<br>
>       {<br>
>               // This allows in-place access to the Metadata contents,<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>