From c4c176e9d3bd72fe1746f22d7afb442ca72a72f2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 26 Apr 2022 00:32:29 +0200 Subject: Add move constructor/operator=. --- src/dcp.cc | 29 +++++++++++++++++++++++++++++ src/dcp.h | 3 +++ 2 files changed, 32 insertions(+) (limited to 'src') diff --git a/src/dcp.cc b/src/dcp.cc index ff51a28f..8924a4b8 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -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* notes, bool ignore_incorrect_picture_mxf_type) { diff --git a/src/dcp.h b/src/dcp.h index c08ccf38..35e2edf8 100644 --- 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. * -- cgit v1.2.3