Allow move construction of ActiveText.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Oct 2022 13:16:30 +0000 (15:16 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Oct 2022 13:16:30 +0000 (15:16 +0200)
src/lib/active_text.cc
src/lib/active_text.h

index 1e0fd6adbcc1bc80b4d90c08a293893bfaf48370..2a5c4d836468a7a8fb3e359e81085c31d807ad55 100644 (file)
@@ -32,6 +32,23 @@ using boost::optional;
 using namespace dcpomatic;
 
 
+ActiveText::ActiveText(ActiveText&& other)
+       : _data(std::move(other._data))
+{
+
+}
+
+
+ActiveText&
+ActiveText::operator=(ActiveText&& other)
+{
+       if (this != &other) {
+               _data = std::move(other._data);
+       }
+       return *this;
+}
+
+
 /** Get the open captions that should be burnt into a given period.
  *  @param period Period of interest.
  *  @param always_burn_captions Always burn captions even if their content is not set to burn.
index d5ce4cb0759895d2b235a9e205c9a8a264e14767..5430f96812578650d6705651416fd0d7eb805d66 100644 (file)
@@ -45,6 +45,9 @@ public:
        ActiveText (ActiveText const&) = delete;
        ActiveText& operator= (ActiveText const&) = delete;
 
+       ActiveText(ActiveText&& other);
+       ActiveText& operator=(ActiveText&& other);
+
        std::list<PlayerText> get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const;
        void clear_before (dcpomatic::DCPTime time);
        void clear ();