Some noncopyable removal.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Feb 2021 23:24:55 +0000 (00:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Feb 2021 23:24:55 +0000 (00:24 +0100)
src/lib/encoder.h
src/lib/player_video.h
src/lib/server.cc
src/lib/server.h
src/lib/signal_manager.cc
src/lib/signal_manager.h

index 78c1f99088b46aae6506c561912647938143ed01..1403e75b2d4f7691d6da67c69d7472b24e96d94a 100644 (file)
@@ -32,13 +32,18 @@ class Job;
 class PlayerVideo;
 class AudioBuffers;
 
-/** @class Encoder */
-class Encoder : public boost::noncopyable
+/** @class Encoder
+ *  @brief Parent class for something that can encode a film into some format
+ */
+class Encoder
 {
 public:
        Encoder (std::shared_ptr<const Film> film, std::weak_ptr<Job> job);
        virtual ~Encoder () {}
 
+       Encoder (Encoder const&) = delete;
+       Encoder& operator= (Encoder const&) = delete;
+
        virtual void go () = 0;
 
        /** @return the current frame rate over the last short while */
index 569789c8cc1cdb6e6918a783ab9364e955c44cdc..df0007ddfd9676a6d25ac69699e5e131575911e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_PLAYER_VIDEO_H
 #define DCPOMATIC_PLAYER_VIDEO_H
 
+
 #include "types.h"
 #include "position.h"
 #include "dcpomatic_time.h"
@@ -30,18 +32,19 @@ extern "C" {
 #include <libavutil/pixfmt.h>
 }
 #include <boost/thread/mutex.hpp>
-#include <boost/noncopyable.hpp>
+
 
 class Image;
 class ImageProxy;
 class Film;
 class Socket;
 
+
 /** Everything needed to describe a video frame coming out of the player, but with the
  *  bits still their raw form.  We may want to combine the bits on a remote machine,
  *  or maybe not even bother to combine them at all.
  */
-class PlayerVideo : public boost::noncopyable
+class PlayerVideo
 {
 public:
        PlayerVideo (
@@ -61,6 +64,9 @@ public:
 
        PlayerVideo (std::shared_ptr<cxml::Node>, std::shared_ptr<Socket>);
 
+       PlayerVideo (PlayerVideo const&) = delete;
+       PlayerVideo& operator= (PlayerVideo const&) = delete;
+
        std::shared_ptr<PlayerVideo> shallow_copy () const;
 
        void set_text (PositionImage);
@@ -143,4 +149,5 @@ private:
        mutable bool _error;
 };
 
+
 #endif
index acb8d08d8e800cbbf429ac1ff924d2ef6c8f75ca..c1be5735e9bb0be7db25831ebab9f44641ec1f3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "server.h"
 #include "dcpomatic_socket.h"
 
+
 #include "i18n.h"
 
+
+using std::make_shared;
 using std::shared_ptr;
 
+
 Server::Server (int port, int timeout)
        : _terminate (false)
        , _acceptor (_io_service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port))
@@ -33,6 +38,7 @@ Server::Server (int port, int timeout)
 
 }
 
+
 Server::~Server ()
 {
        {
@@ -44,6 +50,7 @@ Server::~Server ()
        stop ();
 }
 
+
 void
 Server::run ()
 {
@@ -51,6 +58,7 @@ Server::run ()
        _io_service.run ();
 }
 
+
 void
 Server::start_accept ()
 {
@@ -61,10 +69,11 @@ Server::start_accept ()
                }
        }
 
-       shared_ptr<Socket> socket (new Socket(_timeout));
+       auto socket = make_shared<Socket>(_timeout);
        _acceptor.async_accept (socket->socket (), boost::bind (&Server::handle_accept, this, socket, boost::asio::placeholders::error));
 }
 
+
 void
 Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code const & error)
 {
@@ -76,6 +85,7 @@ Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code cons
        start_accept ();
 }
 
+
 void
 Server::stop ()
 {
index fbcd7e870ff006204739ba26258c26d019dadeb5..0b1950aa7c550e461e2dcf0e1a49ae1964949c49 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_SERVER_H
 #define DCPOMATIC_SERVER_H
 
+
 #include <boost/thread.hpp>
 #include <boost/asio.hpp>
 #include <boost/thread/condition.hpp>
-#include <boost/noncopyable.hpp>
 #include <string>
 
+
 class Socket;
 
-class Server : public boost::noncopyable
+
+class Server
 {
 public:
        explicit Server (int port, int timeout = 30);
        virtual ~Server ();
 
+       Server (Server const&) = delete;
+       Server& operator= (Server const&) = delete;
+
        virtual void run ();
        void stop ();
 
@@ -53,4 +59,5 @@ private:
        int _timeout;
 };
 
+
 #endif
index b052e9e05aa74dea1e0db01af7818c6727200547..942e0510596f54443499710e6db98b28eefdf8af 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,7 +18,9 @@
 
 */
 
+
 #include "signal_manager.h"
 
+
 /** Global SignalManager instance */
-SignalManager* signal_manager = 0;
+SignalManager* signal_manager = nullptr;
index 6ba4a94560b50cd79783a8b5d3e414c344f2f5fe..78e936ea2f46e9a82172265ac27b6316b1c869ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_SIGNAL_MANAGER_H
 #define DCPOMATIC_SIGNAL_MANAGER_H
 
+
 #include "exception_store.h"
 #include <boost/asio.hpp>
 #include <boost/thread.hpp>
 #include <boost/noncopyable.hpp>
 
+
 class Signaller;
 
+
 /** A class to allow signals to be emitted from non-UI threads and handled
  *  by a UI thread.
  */
-class SignalManager : public boost::noncopyable, public ExceptionStore
+class SignalManager : public ExceptionStore
 {
 public:
        /** Create a SignalManager.  Must be called from the UI thread */
@@ -43,6 +47,9 @@ public:
 
        virtual ~SignalManager () {}
 
+       SignalManager (Signaller const&) = delete;
+       SignalManager& operator= (Signaller const&) = delete;
+
        /* Do something next time the UI is idle */
        template <typename T>
        void when_idle (T f) {
@@ -95,6 +102,8 @@ private:
        boost::thread::id _ui_thread;
 };
 
+
 extern SignalManager* signal_manager;
 
+
 #endif