Add move constructor/operator=. dcp-editor3
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Apr 2022 22:32:29 +0000 (00:32 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Apr 2022 22:32:29 +0000 (00:32 +0200)
src/dcp.cc
src/dcp.h

index ff51a28fceec6e3b1a58f3d75bc07da2f558fb98..8924a4b8dc9decb2dd0a776c6745ac640b10c370 100644 (file)
@@ -106,6 +106,35 @@ 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))
+       , _new_issuer(std::move(other._new_issuer))
+       , _new_creator(std::move(other._new_creator))
+       , _new_issue_date(std::move(other._new_issue_date))
+       , _new_annotation_text(std::move(other._new_annotation_text))
+{
+
+}
+
+
+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);
+       _new_issuer = std::move(other._new_issuer);
+       _new_creator = std::move(other._new_creator);
+       _new_issue_date = std::move(other._new_issue_date);
+       _new_annotation_text = std::move(other._new_annotation_text);
+       return *this;
+}
+
+
 void
 DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf_type)
 {
index c08ccf38e0b0e2db5eafe0852d13e4c9c1d4b5d0..35e2edf889272378a125c65d49d7dcef513f9e2b 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -95,6 +95,9 @@ 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.
         *