X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_socket.h;h=f4520e5cf7c070d3407c2196b1baf8ff98939476;hb=6d686ea45f5cd01a0d11f92a903ac77779ad8562;hp=1fa0b046f0c1c7e2490865bfaa41a99114f8dcfb;hpb=3f2bec7b6ee2f27b2de056cdc0137744d2e9e253;p=dcpomatic.git diff --git a/src/lib/dcpomatic_socket.h b/src/lib/dcpomatic_socket.h index 1fa0b046f..f4520e5cf 100644 --- a/src/lib/dcpomatic_socket.h +++ b/src/lib/dcpomatic_socket.h @@ -20,9 +20,7 @@ #include "digester.h" #include -#include #include -#include /** @class Socket * @brief A class to wrap a boost::asio::ip::tcp::socket with some things @@ -31,11 +29,14 @@ * This class wraps some things that I could not work out how to do easily with boost; * most notably, sync read/write calls with timeouts. */ -class Socket : public boost::noncopyable +class Socket { public: explicit Socket (int timeout = 30); + Socket (Socket const&) = delete; + Socket& operator= (Socket const&) = delete; + /** @return Our underlying socket */ boost::asio::ip::tcp::socket& socket () { return _socket; @@ -52,10 +53,10 @@ public: class ReadDigestScope { public: - ReadDigestScope (boost::shared_ptr socket); + ReadDigestScope (std::shared_ptr socket); bool check (); private: - boost::weak_ptr _socket; + std::weak_ptr _socket; }; /** After one of these is created everything that is sent from the socket will be @@ -65,10 +66,10 @@ public: class WriteDigestScope { public: - WriteDigestScope (boost::shared_ptr socket); + WriteDigestScope (std::shared_ptr socket); ~WriteDigestScope (); private: - boost::weak_ptr _socket; + std::weak_ptr _socket; }; private: @@ -80,8 +81,6 @@ private: void start_write_digest (); void finish_write_digest (); - Socket (Socket const &); - boost::asio::io_service _io_service; boost::asio::deadline_timer _deadline; boost::asio::ip::tcp::socket _socket;