Replace boost::noncopyable with C++11 deleted copy constructors

This commit is contained in:
Alejandro Domínguez 2024-08-25 23:41:45 +02:00 committed by Robin Gareus
parent 915200699b
commit 2436b4df06
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
17 changed files with 50 additions and 36 deletions

View file

@ -22,7 +22,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <boost/noncopyable.hpp>
#include <vamp-hostsdk/Plugin.h> #include <vamp-hostsdk/Plugin.h>
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
#include "ardour/types.h" #include "ardour/types.h"
@ -32,13 +31,15 @@ namespace ARDOUR {
class AudioReadable; class AudioReadable;
class Session; class Session;
class LIBARDOUR_API AudioAnalyser : public boost::noncopyable { class LIBARDOUR_API AudioAnalyser {
public: public:
typedef Vamp::Plugin AnalysisPlugin; typedef Vamp::Plugin AnalysisPlugin;
typedef std::string AnalysisPluginKey; typedef std::string AnalysisPluginKey;
AudioAnalyser (float sample_rate, AnalysisPluginKey key); AudioAnalyser (float sample_rate, AnalysisPluginKey key);
AudioAnalyser (const AudioAnalyser&) = delete;
AudioAnalyser& operator= (const AudioAnalyser&) = delete;
virtual ~AudioAnalyser(); virtual ~AudioAnalyser();
/* analysis object should provide a run method /* analysis object should provide a run method

View file

@ -23,8 +23,6 @@
#include <stddef.h> #include <stddef.h>
#include <boost/noncopyable.hpp>
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour/data_type.h" #include "ardour/data_type.h"
@ -41,9 +39,11 @@ namespace ARDOUR {
* *
* To actually read/write buffer contents, use the appropriate derived class. * To actually read/write buffer contents, use the appropriate derived class.
*/ */
class LIBARDOUR_API Buffer : public boost::noncopyable class LIBARDOUR_API Buffer
{ {
public: public:
Buffer (const Buffer&) = delete;
Buffer& operator= (const Buffer&) = delete;
virtual ~Buffer() {} virtual ~Buffer() {}
/** Factory function */ /** Factory function */

View file

@ -29,6 +29,7 @@
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
#include "ardour/processor.h" #include "ardour/processor.h"
#include "ardour/rt_midibuffer.h" #include "ardour/rt_midibuffer.h"
#include "types.h"
namespace PBD { namespace PBD {
template<class T> class PlaybackBuffer; template<class T> class PlaybackBuffer;
@ -142,9 +143,11 @@ protected:
/** Information about one audio channel, playback or capture /** Information about one audio channel, playback or capture
* (depending on the derived class) * (depending on the derived class)
*/ */
struct ChannelInfo : public boost::noncopyable { struct ChannelInfo {
ChannelInfo (samplecnt_t buffer_size); ChannelInfo (samplecnt_t buffer_size);
ChannelInfo (const ChannelInfo&) = delete;
ChannelInfo& operator= (const ChannelInfo&) = delete;
virtual ~ChannelInfo (); virtual ~ChannelInfo ();
/** A semi-random-access ringbuffers for data to be played back. /** A semi-random-access ringbuffers for data to be played back.

View file

@ -31,8 +31,10 @@
namespace ARDOUR { namespace ARDOUR {
struct MidiCursor : public boost::noncopyable { struct MidiCursor {
MidiCursor() {} MidiCursor() {}
MidiCursor(const MidiCursor&) = delete;
MidiCursor& operator=(const MidiCursor&) = delete;
void connect(PBD::Signal<void(bool)>& invalidated) { void connect(PBD::Signal<void(bool)>& invalidated) {
connections.drop_connections(); connections.drop_connections();

View file

@ -31,9 +31,11 @@
namespace ARDOUR { namespace ARDOUR {
class LIBARDOUR_API MonitorPort : public boost::noncopyable class LIBARDOUR_API MonitorPort
{ {
public: public:
MonitorPort (const MonitorPort&) = delete;
MonitorPort& operator= (const MonitorPort&) = delete;
~MonitorPort (); ~MonitorPort ();
void set_buffer_size (pframes_t); void set_buffer_size (pframes_t);

View file

@ -26,8 +26,6 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <boost/noncopyable.hpp>
#include "pbd/cartesian.h" #include "pbd/cartesian.h"
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"

View file

@ -64,13 +64,15 @@ struct AUv2DescStr;
#endif #endif
class LIBARDOUR_API PluginManager : public boost::noncopyable { class LIBARDOUR_API PluginManager {
public: public:
static PluginManager& instance(); static PluginManager& instance();
static std::string auv2_scanner_bin_path; static std::string auv2_scanner_bin_path;
static std::string vst2_scanner_bin_path; static std::string vst2_scanner_bin_path;
static std::string vst3_scanner_bin_path; static std::string vst3_scanner_bin_path;
PluginManager (const PluginManager&) = delete;
PluginManager& operator= (const PluginManager&) = delete;
~PluginManager (); ~PluginManager ();
const ARDOUR::PluginInfoList& windows_vst_plugin_info (); const ARDOUR::PluginInfoList& windows_vst_plugin_info ();

View file

@ -28,7 +28,6 @@
#include <set> #include <set>
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/noncopyable.hpp>
#include "pbd/signals.h" #include "pbd/signals.h"
#include "ardour/data_type.h" #include "ardour/data_type.h"
@ -41,9 +40,11 @@ namespace ARDOUR {
class AudioEngine; class AudioEngine;
class Buffer; class Buffer;
class LIBARDOUR_API Port : public boost::noncopyable class LIBARDOUR_API Port
{ {
public: public:
Port (const Port&) = delete;
Port& operator= (const Port&) = delete;
virtual ~Port (); virtual ~Port ();
static void set_connecting_blocked( bool yn ) { static void set_connecting_blocked( bool yn ) {

View file

@ -20,8 +20,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <boost/noncopyable.hpp>
#include "pbd/signals.h" #include "pbd/signals.h"
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
@ -35,10 +33,12 @@ namespace ARDOUR
class Session; class Session;
class MidiPort; class MidiPort;
class LIBARDOUR_API MidiClockTicker : boost::noncopyable class LIBARDOUR_API MidiClockTicker
{ {
public: public:
MidiClockTicker (Session&); MidiClockTicker (Session&);
MidiClockTicker (const MidiClockTicker&) = delete;
MidiClockTicker& operator= (const MidiClockTicker&) = delete;
virtual ~MidiClockTicker (); virtual ~MidiClockTicker ();
void tick (samplepos_t, samplepos_t, pframes_t, samplecnt_t); void tick (samplepos_t, samplepos_t, pframes_t, samplecnt_t);

View file

@ -20,8 +20,6 @@
#include <string> #include <string>
#include <boost/noncopyable.hpp>
#include "ardour/transport_master.h" #include "ardour/transport_master.h"
#include "ardour/types.h" #include "ardour/types.h"
@ -29,10 +27,12 @@ namespace ARDOUR {
class UI_TransportMaster; class UI_TransportMaster;
class LIBARDOUR_API TransportMasterManager : public boost::noncopyable class LIBARDOUR_API TransportMasterManager
{ {
public: public:
static TransportMasterManager& create (); static TransportMasterManager& create ();
TransportMasterManager (const TransportMasterManager&) = delete;
TransportMasterManager& operator= (const TransportMasterManager&) = delete;
~TransportMasterManager (); ~TransportMasterManager ();
int set_default_configuration (); int set_default_configuration ();

View file

@ -41,11 +41,13 @@ namespace ARDOUR {
* This just uses a pair of std::map and is not so great in the space overhead * 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. * department, but it's fast enough and not really performance critical anyway.
*/ */
class LIBARDOUR_API URIMap : public boost::noncopyable { class LIBARDOUR_API URIMap {
public: public:
static URIMap& instance(); static URIMap& instance();
URIMap(); URIMap();
URIMap(const URIMap&) = delete;
URIMap& operator=(const URIMap&) = delete;
LV2_Feature* urid_map_feature() { return &_urid_map_feature; } LV2_Feature* urid_map_feature() { return &_urid_map_feature; }
LV2_Feature* urid_unmap_feature() { return &_urid_unmap_feature; } LV2_Feature* urid_unmap_feature() { return &_urid_unmap_feature; }

View file

@ -157,9 +157,11 @@ uint32_t LV2Plugin::_ui_contrasting_color = 0x33ff33ff; // RGBA
unsigned long LV2Plugin::_ui_transient_win_id = 0; unsigned long LV2Plugin::_ui_transient_win_id = 0;
class LV2World : boost::noncopyable { class LV2World {
public: public:
LV2World (); LV2World ();
LV2World (const LV2World&) = delete;
LV2World& operator= (const LV2World&) = delete;
~LV2World (); ~LV2World ();
void load_bundled_plugins(bool verbose=false); void load_bundled_plugins(bool verbose=false);

View file

@ -24,8 +24,6 @@
#include <vector> #include <vector>
#include <stdint.h> #include <stdint.h>
#include <boost/noncopyable.hpp>
#include "canvas/visibility.h" #include "canvas/visibility.h"
#include "canvas/types.h" #include "canvas/types.h"
@ -33,10 +31,12 @@ namespace ArdourCanvas {
class Item; class Item;
class LIBCANVAS_API Fill : public boost::noncopyable class LIBCANVAS_API Fill
{ {
public: public:
Fill (Item& self); Fill (Item& self);
Fill (const Fill&) = delete;
Fill& operator= (const Fill&) = delete;
virtual ~Fill() {} virtual ~Fill() {}
virtual void set_fill_color (Gtkmm2ext::Color); virtual void set_fill_color (Gtkmm2ext::Color);

View file

@ -23,8 +23,6 @@
#include <stdint.h> #include <stdint.h>
#include <boost/noncopyable.hpp>
#include "canvas/visibility.h" #include "canvas/visibility.h"
#include "canvas/types.h" #include "canvas/types.h"
@ -32,10 +30,12 @@ namespace ArdourCanvas {
class Item; class Item;
class LIBCANVAS_API Outline : public boost::noncopyable class LIBCANVAS_API Outline
{ {
public: public:
Outline (Item& self); Outline (Item& self);
Outline (const Outline&) = delete;
Outline& operator= (const Outline&) = delete;
virtual ~Outline() {} virtual ~Outline() {}
Gtkmm2ext::Color outline_color () const { Gtkmm2ext::Color outline_color () const {

View file

@ -20,7 +20,6 @@
#define EVORAL_CURVE_HPP #define EVORAL_CURVE_HPP
#include <inttypes.h> #include <inttypes.h>
#include <boost/noncopyable.hpp>
#include "temporal/timeline.h" #include "temporal/timeline.h"
@ -30,10 +29,12 @@ namespace Evoral {
class ControlList; class ControlList;
class LIBEVORAL_API Curve : public boost::noncopyable class LIBEVORAL_API Curve
{ {
public: public:
Curve (const ControlList& cl); 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; 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; void get_vector (Temporal::timepos_t const & x0, Temporal::timepos_t const & x1, float *arg, int32_t veclen) const;

View file

@ -31,10 +31,12 @@ namespace ARDOUR
{ {
class Speakers; class Speakers;
class VBAPSpeakers : public boost::noncopyable class VBAPSpeakers
{ {
public: public:
VBAPSpeakers (std::shared_ptr<Speakers>); VBAPSpeakers (std::shared_ptr<Speakers>);
VBAPSpeakers (const VBAPSpeakers&) = delete;
VBAPSpeakers& operator= (const VBAPSpeakers&) = delete;
typedef std::vector<double> dvector; typedef std::vector<double> dvector;

View file

@ -34,7 +34,6 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include <boost/noncopyable.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/bind/protect.hpp> #include <boost/bind/protect.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
@ -266,19 +265,18 @@ private:
UnscopedConnection _c; UnscopedConnection _c;
}; };
class LIBPBD_API ScopedConnectionList : public boost::noncopyable class LIBPBD_API ScopedConnectionList
{ {
public: public:
ScopedConnectionList(); ScopedConnectionList ();
ScopedConnectionList (const ScopedConnectionList&) = delete;
ScopedConnectionList& operator= (const ScopedConnectionList&) = delete;
virtual ~ScopedConnectionList (); virtual ~ScopedConnectionList ();
void add_connection (const UnscopedConnection& c); void add_connection (const UnscopedConnection& c);
void drop_connections (); void drop_connections ();
private: private:
/* this class is not copyable */
ScopedConnectionList(const ScopedConnectionList&);
/* Even though our signals code is thread-safe, this additional list of /* Even though our signals code is thread-safe, this additional list of
scoped connections needs to be protected in 2 cases: scoped connections needs to be protected in 2 cases: