From 2436b4df063f95fc24d6116582fa6f4a946b224b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Dom=C3=ADnguez?= Date: Sun, 25 Aug 2024 23:41:45 +0200 Subject: [PATCH] Replace boost::noncopyable with C++11 deleted copy constructors --- libs/ardour/ardour/audioanalyser.h | 5 +++-- libs/ardour/ardour/buffer.h | 6 +++--- libs/ardour/ardour/disk_io.h | 5 ++++- libs/ardour/ardour/midi_cursor.h | 4 +++- libs/ardour/ardour/monitor_port.h | 4 +++- libs/ardour/ardour/panner_shell.h | 2 -- libs/ardour/ardour/plugin_manager.h | 4 +++- libs/ardour/ardour/port.h | 5 +++-- libs/ardour/ardour/ticker.h | 6 +++--- libs/ardour/ardour/transport_master_manager.h | 6 +++--- libs/ardour/ardour/uri_map.h | 4 +++- libs/ardour/lv2_plugin.cc | 4 +++- libs/canvas/canvas/fill.h | 6 +++--- libs/canvas/canvas/outline.h | 6 +++--- libs/evoral/evoral/Curve.h | 5 +++-- libs/panners/vbap/vbap_speakers.h | 4 +++- libs/pbd/pbd/signals.h | 10 ++++------ 17 files changed, 50 insertions(+), 36 deletions(-) diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h index 912d980289..dc4ea87dd8 100644 --- a/libs/ardour/ardour/audioanalyser.h +++ b/libs/ardour/ardour/audioanalyser.h @@ -22,7 +22,6 @@ #include #include -#include #include #include "ardour/libardour_visibility.h" #include "ardour/types.h" @@ -32,13 +31,15 @@ namespace ARDOUR { class AudioReadable; class Session; -class LIBARDOUR_API AudioAnalyser : public boost::noncopyable { +class LIBARDOUR_API AudioAnalyser { public: typedef Vamp::Plugin AnalysisPlugin; typedef std::string AnalysisPluginKey; AudioAnalyser (float sample_rate, AnalysisPluginKey key); + AudioAnalyser (const AudioAnalyser&) = delete; + AudioAnalyser& operator= (const AudioAnalyser&) = delete; virtual ~AudioAnalyser(); /* analysis object should provide a run method diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index bb95968ef5..d2edb18f8d 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -23,8 +23,6 @@ #include -#include - #include "ardour/libardour_visibility.h" #include "ardour/types.h" #include "ardour/data_type.h" @@ -41,9 +39,11 @@ namespace ARDOUR { * * To actually read/write buffer contents, use the appropriate derived class. */ -class LIBARDOUR_API Buffer : public boost::noncopyable +class LIBARDOUR_API Buffer { public: + Buffer (const Buffer&) = delete; + Buffer& operator= (const Buffer&) = delete; virtual ~Buffer() {} /** Factory function */ diff --git a/libs/ardour/ardour/disk_io.h b/libs/ardour/ardour/disk_io.h index 2a421570e4..36d91f6fd1 100644 --- a/libs/ardour/ardour/disk_io.h +++ b/libs/ardour/ardour/disk_io.h @@ -29,6 +29,7 @@ #include "ardour/midi_buffer.h" #include "ardour/processor.h" #include "ardour/rt_midibuffer.h" +#include "types.h" namespace PBD { template class PlaybackBuffer; @@ -142,9 +143,11 @@ protected: /** Information about one audio channel, playback or capture * (depending on the derived class) */ - struct ChannelInfo : public boost::noncopyable { + struct ChannelInfo { ChannelInfo (samplecnt_t buffer_size); + ChannelInfo (const ChannelInfo&) = delete; + ChannelInfo& operator= (const ChannelInfo&) = delete; virtual ~ChannelInfo (); /** A semi-random-access ringbuffers for data to be played back. diff --git a/libs/ardour/ardour/midi_cursor.h b/libs/ardour/ardour/midi_cursor.h index ddec62cfcf..50509dd757 100644 --- a/libs/ardour/ardour/midi_cursor.h +++ b/libs/ardour/ardour/midi_cursor.h @@ -31,8 +31,10 @@ namespace ARDOUR { -struct MidiCursor : public boost::noncopyable { +struct MidiCursor { MidiCursor() {} + MidiCursor(const MidiCursor&) = delete; + MidiCursor& operator=(const MidiCursor&) = delete; void connect(PBD::Signal& invalidated) { connections.drop_connections(); diff --git a/libs/ardour/ardour/monitor_port.h b/libs/ardour/ardour/monitor_port.h index fab07a45ba..2d8c6c42f7 100644 --- a/libs/ardour/ardour/monitor_port.h +++ b/libs/ardour/ardour/monitor_port.h @@ -31,9 +31,11 @@ namespace ARDOUR { -class LIBARDOUR_API MonitorPort : public boost::noncopyable +class LIBARDOUR_API MonitorPort { public: + MonitorPort (const MonitorPort&) = delete; + MonitorPort& operator= (const MonitorPort&) = delete; ~MonitorPort (); void set_buffer_size (pframes_t); diff --git a/libs/ardour/ardour/panner_shell.h b/libs/ardour/ardour/panner_shell.h index d09f76e4c9..250656679e 100644 --- a/libs/ardour/ardour/panner_shell.h +++ b/libs/ardour/ardour/panner_shell.h @@ -26,8 +26,6 @@ #include #include -#include - #include "pbd/cartesian.h" #include "ardour/libardour_visibility.h" diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index be1e3fc7ef..5e8d304181 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -64,13 +64,15 @@ struct AUv2DescStr; #endif -class LIBARDOUR_API PluginManager : public boost::noncopyable { +class LIBARDOUR_API PluginManager { public: static PluginManager& instance(); static std::string auv2_scanner_bin_path; static std::string vst2_scanner_bin_path; static std::string vst3_scanner_bin_path; + PluginManager (const PluginManager&) = delete; + PluginManager& operator= (const PluginManager&) = delete; ~PluginManager (); const ARDOUR::PluginInfoList& windows_vst_plugin_info (); diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index bdc768b38a..a1205a5713 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -28,7 +28,6 @@ #include #include #include -#include #include "pbd/signals.h" #include "ardour/data_type.h" @@ -41,9 +40,11 @@ namespace ARDOUR { class AudioEngine; class Buffer; -class LIBARDOUR_API Port : public boost::noncopyable +class LIBARDOUR_API Port { public: + Port (const Port&) = delete; + Port& operator= (const Port&) = delete; virtual ~Port (); static void set_connecting_blocked( bool yn ) { diff --git a/libs/ardour/ardour/ticker.h b/libs/ardour/ardour/ticker.h index 04ac19eb8f..405cdaf627 100644 --- a/libs/ardour/ardour/ticker.h +++ b/libs/ardour/ardour/ticker.h @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - #include "pbd/signals.h" #include "ardour/libardour_visibility.h" @@ -35,10 +33,12 @@ namespace ARDOUR class Session; class MidiPort; -class LIBARDOUR_API MidiClockTicker : boost::noncopyable +class LIBARDOUR_API MidiClockTicker { public: MidiClockTicker (Session&); + MidiClockTicker (const MidiClockTicker&) = delete; + MidiClockTicker& operator= (const MidiClockTicker&) = delete; virtual ~MidiClockTicker (); void tick (samplepos_t, samplepos_t, pframes_t, samplecnt_t); diff --git a/libs/ardour/ardour/transport_master_manager.h b/libs/ardour/ardour/transport_master_manager.h index 7964963a69..2b6d2772df 100644 --- a/libs/ardour/ardour/transport_master_manager.h +++ b/libs/ardour/ardour/transport_master_manager.h @@ -20,8 +20,6 @@ #include -#include - #include "ardour/transport_master.h" #include "ardour/types.h" @@ -29,10 +27,12 @@ namespace ARDOUR { class UI_TransportMaster; -class LIBARDOUR_API TransportMasterManager : public boost::noncopyable +class LIBARDOUR_API TransportMasterManager { public: static TransportMasterManager& create (); + TransportMasterManager (const TransportMasterManager&) = delete; + TransportMasterManager& operator= (const TransportMasterManager&) = delete; ~TransportMasterManager (); int set_default_configuration (); diff --git a/libs/ardour/ardour/uri_map.h b/libs/ardour/ardour/uri_map.h index 3e75fa34bd..f48a09e879 100644 --- a/libs/ardour/ardour/uri_map.h +++ b/libs/ardour/ardour/uri_map.h @@ -41,11 +41,13 @@ namespace ARDOUR { * This just uses a pair of std::map and is not so great in the space overhead * department, but it's fast enough and not really performance critical anyway. */ -class LIBARDOUR_API URIMap : public boost::noncopyable { +class LIBARDOUR_API URIMap { public: static URIMap& instance(); URIMap(); + URIMap(const URIMap&) = delete; + URIMap& operator=(const URIMap&) = delete; LV2_Feature* urid_map_feature() { return &_urid_map_feature; } LV2_Feature* urid_unmap_feature() { return &_urid_unmap_feature; } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index de01e94245..a9dfac8e3b 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -157,9 +157,11 @@ uint32_t LV2Plugin::_ui_contrasting_color = 0x33ff33ff; // RGBA unsigned long LV2Plugin::_ui_transient_win_id = 0; -class LV2World : boost::noncopyable { +class LV2World { public: LV2World (); + LV2World (const LV2World&) = delete; + LV2World& operator= (const LV2World&) = delete; ~LV2World (); void load_bundled_plugins(bool verbose=false); diff --git a/libs/canvas/canvas/fill.h b/libs/canvas/canvas/fill.h index 11e5072c3e..a3c0e3f170 100644 --- a/libs/canvas/canvas/fill.h +++ b/libs/canvas/canvas/fill.h @@ -24,8 +24,6 @@ #include #include -#include - #include "canvas/visibility.h" #include "canvas/types.h" @@ -33,10 +31,12 @@ namespace ArdourCanvas { class Item; -class LIBCANVAS_API Fill : public boost::noncopyable +class LIBCANVAS_API Fill { public: Fill (Item& self); + Fill (const Fill&) = delete; + Fill& operator= (const Fill&) = delete; virtual ~Fill() {} virtual void set_fill_color (Gtkmm2ext::Color); diff --git a/libs/canvas/canvas/outline.h b/libs/canvas/canvas/outline.h index 0308ad1c37..00a09a7c1a 100644 --- a/libs/canvas/canvas/outline.h +++ b/libs/canvas/canvas/outline.h @@ -23,8 +23,6 @@ #include -#include - #include "canvas/visibility.h" #include "canvas/types.h" @@ -32,10 +30,12 @@ namespace ArdourCanvas { class Item; -class LIBCANVAS_API Outline : public boost::noncopyable +class LIBCANVAS_API Outline { public: Outline (Item& self); + Outline (const Outline&) = delete; + Outline& operator= (const Outline&) = delete; virtual ~Outline() {} Gtkmm2ext::Color outline_color () const { diff --git a/libs/evoral/evoral/Curve.h b/libs/evoral/evoral/Curve.h index 9bd574e2d5..6a9b42bfe7 100644 --- a/libs/evoral/evoral/Curve.h +++ b/libs/evoral/evoral/Curve.h @@ -20,7 +20,6 @@ #define EVORAL_CURVE_HPP #include -#include #include "temporal/timeline.h" @@ -30,10 +29,12 @@ namespace Evoral { class ControlList; -class LIBEVORAL_API Curve : public boost::noncopyable +class LIBEVORAL_API Curve { public: Curve (const ControlList& cl); + Curve (const Curve&) = delete; + Curve& operator= (const Curve&) = delete; bool rt_safe_get_vector (Temporal::timepos_t const & x0, Temporal::timepos_t const & x1, float *arg, int32_t veclen) const; void get_vector (Temporal::timepos_t const & x0, Temporal::timepos_t const & x1, float *arg, int32_t veclen) const; diff --git a/libs/panners/vbap/vbap_speakers.h b/libs/panners/vbap/vbap_speakers.h index b30ba5f76d..4957819e2f 100644 --- a/libs/panners/vbap/vbap_speakers.h +++ b/libs/panners/vbap/vbap_speakers.h @@ -31,10 +31,12 @@ namespace ARDOUR { class Speakers; -class VBAPSpeakers : public boost::noncopyable +class VBAPSpeakers { public: VBAPSpeakers (std::shared_ptr); + VBAPSpeakers (const VBAPSpeakers&) = delete; + VBAPSpeakers& operator= (const VBAPSpeakers&) = delete; typedef std::vector dvector; diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index debe6836ba..8143e005a9 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -34,7 +34,6 @@ #include -#include #include #include #include @@ -266,19 +265,18 @@ private: UnscopedConnection _c; }; -class LIBPBD_API ScopedConnectionList : public boost::noncopyable +class LIBPBD_API ScopedConnectionList { public: - ScopedConnectionList(); + ScopedConnectionList (); + ScopedConnectionList (const ScopedConnectionList&) = delete; + ScopedConnectionList& operator= (const ScopedConnectionList&) = delete; virtual ~ScopedConnectionList (); void add_connection (const UnscopedConnection& c); void drop_connections (); private: - /* this class is not copyable */ - ScopedConnectionList(const ScopedConnectionList&); - /* Even though our signals code is thread-safe, this additional list of scoped connections needs to be protected in 2 cases: