Add move constructor.
authorCarl Hetherington <cth@carlh.net>
Sat, 23 Apr 2022 20:35:07 +0000 (22:35 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 23 Apr 2022 20:35:07 +0000 (22:35 +0200)
src/dcp.cc
src/dcp.h

index 05c93b54672f354f7eafafc8d85b111cd7c5438c..da083a354b6410df7701d98d695d36ac57ef0fb4 100644 (file)
@@ -108,6 +108,28 @@ DCP::DCP (boost::filesystem::path directory)
 }
 
 
+DCP::DCP (DCP&& other)
+       : _directory(std::move(other._directory))
+       , _cpls(std::move(other._cpls))
+       , _pkls(std::move(other._pkls))
+       , _asset_map(std::move(other._asset_map))
+       , _standard(std::move(other._standard))
+{
+
+}
+
+
+dcp::DCP& DCP::operator= (DCP&& other)
+{
+       _directory = std::move(other._directory);
+       _cpls = std::move(other._cpls);
+       _pkls = std::move(other._pkls);
+       _asset_map = std::move(other._asset_map);
+       _standard = std::move(other._standard);
+       return *this;
+}
+
+
 void
 DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf_type)
 {
index 6e50c48eb3d94c967fd9246795168e61d66bfc1e..d80aa9db54681aadf1e330202e69c58461d0cf04 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -93,6 +93,8 @@ public:
 
        DCP (DCP const&) = delete;
        DCP& operator= (DCP const&) = delete;
+       DCP (DCP &&);
+       DCP& operator= (DCP &&);
 
        /** Read a DCP.  This method does not do any deep checking of the DCP's validity, but
         *  if it comes across any bad things it will do one of two things.