From b249700e1da7dd6631a8b4440587f4093a2bdef1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 29 Apr 2021 08:31:23 +0200 Subject: [PATCH] Remove use of boost::noncopyable. --- src/lib/active_text.h | 8 ++++++-- src/lib/butler.h | 5 ++++- src/lib/dcp_content_type.h | 10 +++++++++- src/lib/dcp_video.h | 5 ++++- src/lib/dcpomatic_socket.h | 8 ++++---- src/lib/film.h | 5 ++++- src/lib/filter.h | 11 +++++++++-- src/lib/filter_graph.h | 5 ++++- src/lib/image_proxy.h | 6 +++++- src/lib/j2k_encoder.h | 5 ++++- src/lib/job.h | 5 ++++- src/lib/resampler.h | 9 +++++++-- src/lib/scoped_temporary.h | 8 ++++++-- src/lib/signal_manager.h | 1 - src/lib/subtitle_analysis.h | 6 ++++-- src/lib/video_ring_buffers.h | 8 ++++++-- src/lib/zipper.h | 6 ++++-- src/wx/content_menu.h | 5 ++++- src/wx/content_panel.h | 5 ++++- src/wx/job_view.h | 6 ++++-- src/wx/language_tag_widget.h | 6 ++++-- 21 files changed, 100 insertions(+), 33 deletions(-) diff --git a/src/lib/active_text.h b/src/lib/active_text.h index f5211ae7f..b54957b3f 100644 --- a/src/lib/active_text.h +++ b/src/lib/active_text.h @@ -24,7 +24,6 @@ #include "dcpomatic_time.h" #include "player_text.h" -#include #include #include #include @@ -34,9 +33,14 @@ class TextContent; /** @class ActiveText * @brief A class to maintain information on active subtitles for Player. */ -class ActiveText : public boost::noncopyable +class ActiveText { public: + ActiveText () {} + + ActiveText (ActiveText const&) = delete; + ActiveText& operator= (ActiveText const&) = delete; + std::list get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const; void clear_before (dcpomatic::DCPTime time); void clear (); diff --git a/src/lib/butler.h b/src/lib/butler.h index 8c7f554cb..ac83cecec 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -32,7 +32,7 @@ class Player; class PlayerVideo; -class Butler : public ExceptionStore, public boost::noncopyable +class Butler : public ExceptionStore { public: Butler ( @@ -48,6 +48,9 @@ public: ~Butler (); + Butler (Butler const&) = delete; + Butler& operator= (Butler const&) = delete; + void seek (dcpomatic::DCPTime position, bool accurate); class Error { diff --git a/src/lib/dcp_content_type.h b/src/lib/dcp_content_type.h index eea698217..f45bbb9f8 100644 --- a/src/lib/dcp_content_type.h +++ b/src/lib/dcp_content_type.h @@ -18,25 +18,32 @@ */ + #ifndef DCPOMATIC_DCP_CONTENT_TYPE_H #define DCPOMATIC_DCP_CONTENT_TYPE_H + /** @file src/dcp_content_type.h * @brief DCPContentType class. */ + #include #include #include + /** @class DCPContentType * @brief A description of the type of content for a DCP (e.g. feature, trailer etc.) */ -class DCPContentType : public boost::noncopyable +class DCPContentType { public: DCPContentType (std::string, dcp::ContentKind, std::string); + DCPContentType (DCPContentType const&) = delete; + DCPContentType& operator= (DCPContentType const&) = delete; + /** @return user-visible `pretty' name */ std::string pretty_name () const { return _pretty_name; @@ -66,4 +73,5 @@ private: static std::vector _dcp_content_types; }; + #endif diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h index 8efd680a2..0bb583c57 100644 --- a/src/lib/dcp_video.h +++ b/src/lib/dcp_video.h @@ -39,12 +39,15 @@ class PlayerVideo; * Objects of this class are used for the queue that we keep * of images that require encoding. */ -class DCPVideo : public boost::noncopyable +class DCPVideo { public: DCPVideo (std::shared_ptr, int index, int dcp_fps, int bandwidth, Resolution r); DCPVideo (std::shared_ptr, cxml::ConstNodePtr); + DCPVideo (DCPVideo const&) = delete; + DCPVideo& operator= (DCPVideo const&) = delete; + dcp::ArrayData encode_locally (); dcp::ArrayData encode_remotely (EncodeServerDescription, int timeout = 30); diff --git a/src/lib/dcpomatic_socket.h b/src/lib/dcpomatic_socket.h index 49a278588..f4520e5cf 100644 --- a/src/lib/dcpomatic_socket.h +++ b/src/lib/dcpomatic_socket.h @@ -20,7 +20,6 @@ #include "digester.h" #include -#include #include /** @class Socket @@ -30,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; @@ -79,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; diff --git a/src/lib/film.h b/src/lib/film.h index 00c3f71c5..bb868ffad 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -93,12 +93,15 @@ private: * * The content of a Film is held in a Playlist (created and managed by the Film). */ -class Film : public std::enable_shared_from_this, public Signaller, public boost::noncopyable +class Film : public std::enable_shared_from_this, public Signaller { public: explicit Film (boost::optional dir); ~Film (); + Film (Film const&) = delete; + Film& operator= (Film const&) = delete; + std::shared_ptr info_file_handle (dcpomatic::DCPTimePeriod period, bool read) const; boost::filesystem::path j2c_path (int, Frame, Eyes, bool) const; boost::filesystem::path internal_video_asset_dir () const; diff --git a/src/lib/filter.h b/src/lib/filter.h index 455b271a2..5fbfd9c23 100644 --- a/src/lib/filter.h +++ b/src/lib/filter.h @@ -18,17 +18,20 @@ */ + /** @file src/filter.h * @brief A class to describe one of FFmpeg's video or audio filters. */ + #ifndef DCPOMATIC_FILTER_H #define DCPOMATIC_FILTER_H -#include + #include #include + /** @class Filter * @brief A class to describe one of FFmpeg's video or audio filters. * @@ -36,11 +39,14 @@ * 8bpp. FFmpeg quantizes e.g. yuv422p10le down to yuv422p before running such filters, which * we don't really want to do. */ -class Filter : public boost::noncopyable +class Filter { public: Filter (std::string i, std::string n, std::string c, std::string f); + Filter (Filter const&) = delete; + Filter& operator= (Filter const&) = delete; + /** @return our id */ std::string id () const { return _id; @@ -80,4 +86,5 @@ private: static void maybe_add (std::string, std::string, std::string, std::string); }; + #endif diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h index 10298cb74..2b54d7829 100644 --- a/src/lib/filter_graph.h +++ b/src/lib/filter_graph.h @@ -38,12 +38,15 @@ class Filter; /** @class FilterGraph * @brief A graph of FFmpeg filters. */ -class FilterGraph : public boost::noncopyable +class FilterGraph { public: FilterGraph (); virtual ~FilterGraph (); + FilterGraph (FilterGraph const&) = delete; + FilterGraph& operator== (FilterGraph const&) = delete; + void setup (std::vector); AVFilterContext* get (std::string name); diff --git a/src/lib/image_proxy.h b/src/lib/image_proxy.h index b279e6344..22946ed98 100644 --- a/src/lib/image_proxy.h +++ b/src/lib/image_proxy.h @@ -54,11 +54,15 @@ namespace cxml { * the TIFF data compressed until the decompressed image is needed. * At this point, the class decodes the TIFF to an Image. */ -class ImageProxy : public boost::noncopyable +class ImageProxy { public: + ImageProxy () {} virtual ~ImageProxy () {} + ImageProxy (ImageProxy const&) = delete; + ImageProxy& operator= (ImageProxy const&) = delete; + struct Result { Result (std::shared_ptr image_, int log2_scaling_) : image (image_) diff --git a/src/lib/j2k_encoder.h b/src/lib/j2k_encoder.h index 06b4d429c..cea965309 100644 --- a/src/lib/j2k_encoder.h +++ b/src/lib/j2k_encoder.h @@ -55,12 +55,15 @@ class PlayerVideo; * This class keeps a queue of frames to be encoded and distributes * the work around threads and encoding servers. */ -class J2KEncoder : public boost::noncopyable, public ExceptionStore, public std::enable_shared_from_this +class J2KEncoder : public ExceptionStore, public std::enable_shared_from_this { public: J2KEncoder (std::shared_ptr film, std::shared_ptr writer); ~J2KEncoder (); + J2KEncoder (J2KEncoder const&) = delete; + J2KEncoder& operator= (J2KEncoder const&) = delete; + /** Called to indicate that a processing run is about to begin */ void begin (); diff --git a/src/lib/job.h b/src/lib/job.h index d047913a0..6d8435c60 100644 --- a/src/lib/job.h +++ b/src/lib/job.h @@ -36,12 +36,15 @@ class Film; /** @class Job * @brief A parent class to represent long-running tasks which are run in their own thread. */ -class Job : public std::enable_shared_from_this, public Signaller, public boost::noncopyable +class Job : public std::enable_shared_from_this, public Signaller { public: explicit Job (std::shared_ptr film); virtual ~Job (); + Job (Job const&) = delete; + Job& operator= (Job const&) = delete; + /** @return user-readable name of this job */ virtual std::string name () const = 0; virtual std::string json_name () const = 0; diff --git a/src/lib/resampler.h b/src/lib/resampler.h index 1f8200c69..5a3a7fa40 100644 --- a/src/lib/resampler.h +++ b/src/lib/resampler.h @@ -18,18 +18,23 @@ */ + #include "types.h" #include -#include + class AudioBuffers; -class Resampler : public boost::noncopyable + +class Resampler { public: Resampler (int, int, int); ~Resampler (); + Resampler (Resampler const&) = delete; + Resampler& operator= (Resampler const&) = delete; + std::shared_ptr run (std::shared_ptr); std::shared_ptr flush (); void reset (); diff --git a/src/lib/scoped_temporary.h b/src/lib/scoped_temporary.h index 986f565a0..8f7416093 100644 --- a/src/lib/scoped_temporary.h +++ b/src/lib/scoped_temporary.h @@ -18,19 +18,23 @@ */ + #include -#include #include + /** @class ScopedTemporary * @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope. */ -class ScopedTemporary : public boost::noncopyable +class ScopedTemporary { public: ScopedTemporary (); ~ScopedTemporary (); + ScopedTemporary (ScopedTemporary const&) = delete; + ScopedTemporary& operator= (ScopedTemporary const&) = delete; + /** @return temporary filename */ boost::filesystem::path file () const { return _file; diff --git a/src/lib/signal_manager.h b/src/lib/signal_manager.h index 78e936ea2..99e3b5c52 100644 --- a/src/lib/signal_manager.h +++ b/src/lib/signal_manager.h @@ -26,7 +26,6 @@ #include "exception_store.h" #include #include -#include class Signaller; diff --git a/src/lib/subtitle_analysis.h b/src/lib/subtitle_analysis.h index 0a9dc6dca..04dcc9501 100644 --- a/src/lib/subtitle_analysis.h +++ b/src/lib/subtitle_analysis.h @@ -20,14 +20,13 @@ #include "rect.h" -#include #include /** @class SubtitleAnalysis * @brief Class to store the results of a SubtitleAnalysisJob. */ -class SubtitleAnalysis : public boost::noncopyable +class SubtitleAnalysis { public: explicit SubtitleAnalysis (boost::filesystem::path path); @@ -42,6 +41,9 @@ public: , _analysis_y_offset (analysis_y_offset_) {} + SubtitleAnalysis (SubtitleAnalysis const&) = delete; + SubtitleAnalysis& operator= (SubtitleAnalysis const&) = delete; + void write (boost::filesystem::path path) const; boost::optional> bounding_box () const { diff --git a/src/lib/video_ring_buffers.h b/src/lib/video_ring_buffers.h index 444a49ea7..47fda01f7 100644 --- a/src/lib/video_ring_buffers.h +++ b/src/lib/video_ring_buffers.h @@ -22,7 +22,6 @@ #include "dcpomatic_time.h" #include "player_video.h" #include "types.h" -#include #include #include @@ -31,9 +30,14 @@ class Film; class PlayerVideo; -class VideoRingBuffers : public boost::noncopyable +class VideoRingBuffers { public: + VideoRingBuffers () {} + + VideoRingBuffers (VideoRingBuffers const&) = delete; + VideoRingBuffers& operator= (VideoRingBuffers const&) = delete; + void put (std::shared_ptr frame, dcpomatic::DCPTime time); std::pair, dcpomatic::DCPTime> get (); diff --git a/src/lib/zipper.h b/src/lib/zipper.h index 62a6af5b9..9f3e867c7 100644 --- a/src/lib/zipper.h +++ b/src/lib/zipper.h @@ -19,17 +19,19 @@ */ -#include #include #include -class Zipper : public boost::noncopyable +class Zipper { public: Zipper (boost::filesystem::path file); ~Zipper (); + Zipper (Zipper const&) = delete; + Zipper& operator= (Zipper const&) = delete; + void add (std::string name, std::string content); void close (); diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h index 7743d0712..8a3548419 100644 --- a/src/wx/content_menu.h +++ b/src/wx/content_menu.h @@ -30,11 +30,14 @@ class Film; class Job; class DCPContent; -class ContentMenu : public boost::noncopyable +class ContentMenu { public: explicit ContentMenu (wxWindow* p); + ContentMenu (ContentMenu const &) = delete; + ContentMenu& operator= (ContentMenu const &) = delete; + void popup (std::weak_ptr, ContentList, TimelineContentViewList, wxPoint); private: diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index 2a74df215..aca818118 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -64,11 +64,14 @@ private: }; -class ContentPanel : public boost::noncopyable +class ContentPanel { public: ContentPanel (wxNotebook *, std::shared_ptr, std::weak_ptr viewer); + ContentPanel (ContentPanel const&) = delete; + ContentPanel& operator= (ContentPanel const&) = delete; + std::shared_ptr film () const { return _film; } diff --git a/src/wx/job_view.h b/src/wx/job_view.h index 19f746b01..4a602fc62 100644 --- a/src/wx/job_view.h +++ b/src/wx/job_view.h @@ -21,7 +21,6 @@ #ifndef DCPOMATIC_JOB_VIEW_H #define DCPOMATIC_JOB_VIEW_H -#include #include class Job; @@ -36,12 +35,15 @@ class wxButton; class wxSizer; class wxCheckBox; -class JobView : public boost::noncopyable +class JobView { public: JobView (std::shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table); virtual ~JobView () {} + JobView (JobView const&) = delete; + JobView& operator= (JobView const&) = delete; + virtual int insert_position () const = 0; virtual void job_list_changed () {} diff --git a/src/wx/language_tag_widget.h b/src/wx/language_tag_widget.h index c2fd63d92..16c00e3a6 100644 --- a/src/wx/language_tag_widget.h +++ b/src/wx/language_tag_widget.h @@ -21,7 +21,6 @@ #include #include -#include #include @@ -31,12 +30,15 @@ class wxStaticText; class wxWindow; -class LanguageTagWidget : public boost::noncopyable +class LanguageTagWidget { public: LanguageTagWidget (wxWindow* parent, wxString tooltip, boost::optional tag, boost::optional size_to_fit = boost::none); ~LanguageTagWidget (); + LanguageTagWidget (LanguageTagWidget const&) = delete; + LanguageTagWidget& operator= (LanguageTagWidget const&) = delete; + wxSizer* sizer () const { return _sizer; } -- 2.30.2