summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-16 22:20:39 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-16 22:20:39 +0100
commitbfc0b96db6cc6c2e94d93f9c4239adca14a6bb0c (patch)
tree1038f16144cfe58995e31650925f066b67fda677 /src
parente16c8ed02a0cb1f733a990d75a9de1bf50cf89bd (diff)
More noncopyable.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_content.cc8
-rw-r--r--src/lib/audio_content.h1
-rw-r--r--src/lib/audio_mapping.h2
-rw-r--r--src/lib/config.h2
-rw-r--r--src/lib/content.cc11
-rw-r--r--src/lib/content.h4
-rw-r--r--src/lib/dcp_content_type.h2
-rw-r--r--src/lib/dcp_video_frame.h8
-rw-r--r--src/lib/decoder.h2
-rw-r--r--src/lib/encoder.h2
-rw-r--r--src/lib/ffmpeg_content.cc19
-rw-r--r--src/lib/ffmpeg_content.h2
-rw-r--r--src/lib/ffmpeg_decoder.h4
-rw-r--r--src/lib/film.h6
-rw-r--r--src/lib/filter.h3
-rw-r--r--src/lib/filter_graph.h2
-rw-r--r--src/lib/imagemagick_content.cc6
-rw-r--r--src/lib/imagemagick_content.h1
-rw-r--r--src/lib/job_manager.h2
-rw-r--r--src/lib/log.h2
-rw-r--r--src/lib/player.h2
-rw-r--r--src/lib/playlist.cc8
-rw-r--r--src/lib/playlist.h3
-rw-r--r--src/lib/ratio.h3
-rw-r--r--src/lib/resampler.h3
-rw-r--r--src/lib/scaler.h3
-rw-r--r--src/lib/server.h4
-rw-r--r--src/lib/sndfile_content.cc6
-rw-r--r--src/lib/sndfile_content.h1
-rw-r--r--src/lib/sound_processor.h3
-rw-r--r--src/lib/transcoder.h2
-rw-r--r--src/lib/ui_signaller.h2
-rw-r--r--src/lib/video_content.cc10
-rw-r--r--src/lib/video_content.h1
-rw-r--r--src/lib/writer.h2
35 files changed, 31 insertions, 111 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc
index e93f348f4..4814f8244 100644
--- a/src/lib/audio_content.cc
+++ b/src/lib/audio_content.cc
@@ -58,14 +58,6 @@ AudioContent::AudioContent (shared_ptr<const Film> f, shared_ptr<const cxml::Nod
_audio_delay = node->number_child<int> ("AudioDelay");
}
-AudioContent::AudioContent (AudioContent const & o)
- : Content (o)
- , _audio_gain (o._audio_gain)
- , _audio_delay (o._audio_delay)
-{
-
-}
-
void
AudioContent::as_xml (xmlpp::Node* node) const
{
diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h
index 9bf53e0ab..239a9dc98 100644
--- a/src/lib/audio_content.h
+++ b/src/lib/audio_content.h
@@ -46,7 +46,6 @@ public:
AudioContent (boost::shared_ptr<const Film>, Time);
AudioContent (boost::shared_ptr<const Film>, boost::filesystem::path);
AudioContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
- AudioContent (AudioContent const &);
void as_xml (xmlpp::Node *) const;
diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h
index a2de8306b..ed2c3f28d 100644
--- a/src/lib/audio_mapping.h
+++ b/src/lib/audio_mapping.h
@@ -38,6 +38,8 @@ public:
AudioMapping ();
AudioMapping (int);
AudioMapping (boost::shared_ptr<const cxml::Node>);
+
+ /* Default copy constructor is fine */
void as_xml (xmlpp::Node *) const;
diff --git a/src/lib/config.h b/src/lib/config.h
index 38664f093..77287e686 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -40,7 +40,7 @@ class Ratio;
/** @class Config
* @brief A singleton class holding configuration.
*/
-class Config
+class Config : public boost::noncopyable
{
public:
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 49c579fb6..b49ea4316 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -57,17 +57,6 @@ Content::Content (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
_start = node->number_child<Time> ("Start");
}
-Content::Content (Content const & o)
- : boost::enable_shared_from_this<Content> (o)
- , _film (o._film)
- , _file (o._file)
- , _digest (o._digest)
- , _start (o._start)
- , _change_signals_frequent (o._change_signals_frequent)
-{
-
-}
-
void
Content::as_xml (xmlpp::Node* node) const
{
diff --git a/src/lib/content.h b/src/lib/content.h
index cd8914cba..a340fb1aa 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -42,20 +42,18 @@ public:
static int const LENGTH;
};
-class Content : public boost::enable_shared_from_this<Content>
+class Content : public boost::enable_shared_from_this<Content>, public boost::noncopyable
{
public:
Content (boost::shared_ptr<const Film>, Time);
Content (boost::shared_ptr<const Film>, boost::filesystem::path);
Content (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
- Content (Content const &);
virtual ~Content () {}
virtual void examine (boost::shared_ptr<Job>);
virtual std::string summary () const = 0;
virtual std::string information () const = 0;
virtual void as_xml (xmlpp::Node *) const;
- virtual boost::shared_ptr<Content> clone () const = 0;
virtual Time length () const = 0;
boost::filesystem::path file () const {
diff --git a/src/lib/dcp_content_type.h b/src/lib/dcp_content_type.h
index 14204bd72..965c16347 100644
--- a/src/lib/dcp_content_type.h
+++ b/src/lib/dcp_content_type.h
@@ -31,7 +31,7 @@
/** @class DCPContentType
* @brief A description of the type of content for a DCP (e.g. feature, trailer etc.)
*/
-class DCPContentType
+class DCPContentType : public boost::noncopyable
{
public:
DCPContentType (std::string, libdcp::ContentKind, std::string);
diff --git a/src/lib/dcp_video_frame.h b/src/lib/dcp_video_frame.h
index 25a3e9926..9929b9a8a 100644
--- a/src/lib/dcp_video_frame.h
+++ b/src/lib/dcp_video_frame.h
@@ -36,7 +36,7 @@ class Subtitle;
/** @class EncodedData
* @brief Container for J2K-encoded data.
*/
-class EncodedData
+class EncodedData : public boost::noncopyable
{
public:
/** @param s Size of data, in bytes */
@@ -63,10 +63,6 @@ public:
protected:
uint8_t* _data; ///< data
int _size; ///< data size in bytes
-
-private:
- /* No copy construction */
- EncodedData (EncodedData const &);
};
/** @class LocallyEncodedData
@@ -102,7 +98,7 @@ public:
* Objects of this class are used for the queue that we keep
* of images that require encoding.
*/
-class DCPVideoFrame
+class DCPVideoFrame : public boost::noncopyable
{
public:
DCPVideoFrame (boost::shared_ptr<const Image>, int, int, int, boost::shared_ptr<Log>);
diff --git a/src/lib/decoder.h b/src/lib/decoder.h
index dea4def3a..6cce9e68d 100644
--- a/src/lib/decoder.h
+++ b/src/lib/decoder.h
@@ -39,7 +39,7 @@ class FilterGraph;
/** @class Decoder.
* @brief Parent class for decoders of content.
*/
-class Decoder
+class Decoder : public boost::noncopyable
{
public:
Decoder (boost::shared_ptr<const Film>);
diff --git a/src/lib/encoder.h b/src/lib/encoder.h
index b5a641f50..a6e5932be 100644
--- a/src/lib/encoder.h
+++ b/src/lib/encoder.h
@@ -53,7 +53,7 @@ class Job;
* is supplied as uncompressed PCM in blocks of various sizes.
*/
-class Encoder
+class Encoder : public boost::noncopyable
{
public:
Encoder (boost::shared_ptr<const Film> f, boost::shared_ptr<Job>);
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 487325d71..4c9b1d166 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -82,19 +82,6 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> f, shared_ptr<const cxml::N
_first_video = node->optional_number_child<double> ("FirstVideo");
}
-FFmpegContent::FFmpegContent (FFmpegContent const & o)
- : Content (o)
- , VideoContent (o)
- , AudioContent (o)
- , SubtitleContent (o)
- , _subtitle_streams (o._subtitle_streams)
- , _subtitle_stream (o._subtitle_stream)
- , _audio_streams (o._audio_streams)
- , _audio_stream (o._audio_stream)
-{
-
-}
-
void
FFmpegContent::as_xml (xmlpp::Node* node) const
{
@@ -333,12 +320,6 @@ FFmpegSubtitleStream::as_xml (xmlpp::Node* root) const
root->add_child("Id")->add_child_text (lexical_cast<string> (id));
}
-shared_ptr<Content>
-FFmpegContent::clone () const
-{
- return shared_ptr<Content> (new FFmpegContent (*this));
-}
-
Time
FFmpegContent::length () const
{
diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h
index dba06990b..bf550942a 100644
--- a/src/lib/ffmpeg_content.h
+++ b/src/lib/ffmpeg_content.h
@@ -91,7 +91,6 @@ class FFmpegContent : public VideoContent, public AudioContent, public SubtitleC
public:
FFmpegContent (boost::shared_ptr<const Film>, boost::filesystem::path);
FFmpegContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
- FFmpegContent (FFmpegContent const &);
boost::shared_ptr<FFmpegContent> shared_from_this () {
return boost::dynamic_pointer_cast<FFmpegContent> (Content::shared_from_this ());
@@ -101,7 +100,6 @@ public:
std::string summary () const;
std::string information () const;
void as_xml (xmlpp::Node *) const;
- boost::shared_ptr<Content> clone () const;
Time length () const;
std::string identifier () const;
diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h
index 73edcccb4..fa318e568 100644
--- a/src/lib/ffmpeg_decoder.h
+++ b/src/lib/ffmpeg_decoder.h
@@ -57,10 +57,6 @@ public:
private:
friend class ::ffmpeg_pts_offset_test;
- /* No copy construction */
- FFmpegDecoder (FFmpegDecoder const &);
- FFmpegDecoder& operator= (FFmpegDecoder const &);
-
static double compute_pts_offset (double, double, float);
void setup_subtitle ();
diff --git a/src/lib/film.h b/src/lib/film.h
index 96ba3eafd..f4065757b 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -49,7 +49,7 @@ class Player;
*
* The content of a Film is held in a Playlist (created and managed by the Film)
*/
-class Film : public boost::enable_shared_from_this<Film>
+class Film : public boost::enable_shared_from_this<Film>, public boost::noncopyable
{
public:
Film (std::string d);
@@ -225,10 +225,6 @@ public:
private:
- /* No copy construction */
- Film (Film const &);
- Film & operator= (Film const &);
-
void signal_changed (Property);
std::string video_identifier () const;
void playlist_changed ();
diff --git a/src/lib/filter.h b/src/lib/filter.h
index 7587312c2..5971cd5cf 100644
--- a/src/lib/filter.h
+++ b/src/lib/filter.h
@@ -26,11 +26,12 @@
#include <string>
#include <vector>
+#include <boost/utility.hpp>
/** @class Filter
* @brief A class to describe one of FFmpeg's video or post-processing filters.
*/
-class Filter
+class Filter : public boost::noncopyable
{
public:
Filter (std::string, std::string, std::string, std::string, std::string);
diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h
index 494290795..49b78df16 100644
--- a/src/lib/filter_graph.h
+++ b/src/lib/filter_graph.h
@@ -32,7 +32,7 @@ class VideoFilter;
/** @class FilterGraph
* @brief A graph of FFmpeg filters.
*/
-class FilterGraph
+class FilterGraph : public boost::noncopyable
{
public:
FilterGraph (boost::shared_ptr<const FFmpegContent> content, libdcp::Size s, AVPixelFormat p);
diff --git a/src/lib/imagemagick_content.cc b/src/lib/imagemagick_content.cc
index 8e858d0d1..ae3e18137 100644
--- a/src/lib/imagemagick_content.cc
+++ b/src/lib/imagemagick_content.cc
@@ -80,12 +80,6 @@ ImageMagickContent::examine (shared_ptr<Job> job)
take_from_video_examiner (examiner);
}
-shared_ptr<Content>
-ImageMagickContent::clone () const
-{
- return shared_ptr<Content> (new ImageMagickContent (*this));
-}
-
void
ImageMagickContent::set_video_length (VideoContent::Frame len)
{
diff --git a/src/lib/imagemagick_content.h b/src/lib/imagemagick_content.h
index dab3158e3..50191cc5a 100644
--- a/src/lib/imagemagick_content.h
+++ b/src/lib/imagemagick_content.h
@@ -40,7 +40,6 @@ public:
void examine (boost::shared_ptr<Job>);
std::string summary () const;
void as_xml (xmlpp::Node *) const;
- boost::shared_ptr<Content> clone () const;
Time length () const;
std::string identifier () const;
diff --git a/src/lib/job_manager.h b/src/lib/job_manager.h
index 9c107c190..7d58dcfe6 100644
--- a/src/lib/job_manager.h
+++ b/src/lib/job_manager.h
@@ -30,7 +30,7 @@ class Job;
/** @class JobManager
* @brief A simple scheduler for jobs.
*/
-class JobManager
+class JobManager : public boost::noncopyable
{
public:
diff --git a/src/lib/log.h b/src/lib/log.h
index 3ad6516c1..bd0066a83 100644
--- a/src/lib/log.h
+++ b/src/lib/log.h
@@ -30,7 +30,7 @@
/** @class Log
* @brief A very simple logging class.
*/
-class Log
+class Log : public boost::noncopyable
{
public:
Log ();
diff --git a/src/lib/player.h b/src/lib/player.h
index 2d8eca9b3..568c7a7a1 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -41,7 +41,7 @@ class Resampler;
* @brief A class which can `play' a Playlist; emitting its audio and video.
*/
-class Player : public boost::enable_shared_from_this<Player>
+class Player : public boost::enable_shared_from_this<Player>, public boost::noncopyable
{
public:
Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist>);
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 5aa913bc7..8c4a7f7d7 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -55,14 +55,6 @@ Playlist::Playlist ()
}
-Playlist::Playlist (shared_ptr<const Playlist> other)
- : _loop (other->_loop)
-{
- for (ContentList::const_iterator i = other->_content.begin(); i != other->_content.end(); ++i) {
- _content.push_back ((*i)->clone ());
- }
-}
-
Playlist::~Playlist ()
{
_content.clear ();
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index 0b928fe51..5346dd5e7 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -52,11 +52,10 @@ struct ContentSorter
bool operator() (boost::shared_ptr<Content> a, boost::shared_ptr<Content> b);
};
-class Playlist
+class Playlist : public boost::noncopyable
{
public:
Playlist ();
- Playlist (boost::shared_ptr<const Playlist>);
~Playlist ();
void as_xml (xmlpp::Node *);
diff --git a/src/lib/ratio.h b/src/lib/ratio.h
index 5480eee12..c331edabe 100644
--- a/src/lib/ratio.h
+++ b/src/lib/ratio.h
@@ -21,9 +21,10 @@
#define DCPOMATIC_RATIO_H
#include <vector>
+#include <boost/utility.hpp>
#include <libdcp/util.h>
-class Ratio
+class Ratio : public boost::noncopyable
{
public:
Ratio (float ratio, std::string id, std::string n, std::string d)
diff --git a/src/lib/resampler.h b/src/lib/resampler.h
index 7c85773c0..6e282838a 100644
--- a/src/lib/resampler.h
+++ b/src/lib/resampler.h
@@ -18,13 +18,14 @@
*/
#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
extern "C" {
#include <libswresample/swresample.h>
}
class AudioBuffers;
-class Resampler
+class Resampler : public boost::noncopyable
{
public:
Resampler (int, int, int);
diff --git a/src/lib/scaler.h b/src/lib/scaler.h
index a736e92de..6a039edd8 100644
--- a/src/lib/scaler.h
+++ b/src/lib/scaler.h
@@ -26,11 +26,12 @@
#include <string>
#include <vector>
+#include <boost/utility.hpp>
/** @class Scaler
* @brief Class to describe one of FFmpeg's software scalers
*/
-class Scaler
+class Scaler : public boost::noncopyable
{
public:
Scaler (int f, std::string i, std::string n);
diff --git a/src/lib/server.h b/src/lib/server.h
index 398401a55..e6d374369 100644
--- a/src/lib/server.h
+++ b/src/lib/server.h
@@ -50,6 +50,8 @@ public:
{}
ServerDescription (boost::shared_ptr<const cxml::Node>);
+
+ /* Default copy constructor is fine */
/** @return server's host name or IP address in string form */
std::string host_name () const {
@@ -80,7 +82,7 @@ private:
int _threads;
};
-class Server
+class Server : public boost::noncopyable
{
public:
Server (boost::shared_ptr<Log> log);
diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc
index beee7cd9d..2dd7d8f67 100644
--- a/src/lib/sndfile_content.cc
+++ b/src/lib/sndfile_content.cc
@@ -85,12 +85,6 @@ SndfileContent::valid_file (boost::filesystem::path f)
return (ext == ".wav" || ext == ".aif" || ext == ".aiff");
}
-shared_ptr<Content>
-SndfileContent::clone () const
-{
- return shared_ptr<Content> (new SndfileContent (*this));
-}
-
void
SndfileContent::examine (shared_ptr<Job> job)
{
diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h
index e3b775e8b..87350eac7 100644
--- a/src/lib/sndfile_content.h
+++ b/src/lib/sndfile_content.h
@@ -43,7 +43,6 @@ public:
std::string summary () const;
std::string information () const;
void as_xml (xmlpp::Node *) const;
- boost::shared_ptr<Content> clone () const;
Time length () const;
/* AudioContent */
diff --git a/src/lib/sound_processor.h b/src/lib/sound_processor.h
index bdbe72ba2..8f2652243 100644
--- a/src/lib/sound_processor.h
+++ b/src/lib/sound_processor.h
@@ -26,11 +26,12 @@
#include <string>
#include <vector>
+#include <boost/utility.hpp>
/** @class SoundProcessor
* @brief Class to describe a sound processor.
*/
-class SoundProcessor
+class SoundProcessor : public boost::noncopyable
{
public:
SoundProcessor (std::string i, std::string n);
diff --git a/src/lib/transcoder.h b/src/lib/transcoder.h
index b3c8f888b..007065b65 100644
--- a/src/lib/transcoder.h
+++ b/src/lib/transcoder.h
@@ -36,7 +36,7 @@ class Player;
* A decoder is selected according to the content type, and the encoder can be specified
* as a parameter to the constructor.
*/
-class Transcoder
+class Transcoder : public boost::noncopyable
{
public:
Transcoder (
diff --git a/src/lib/ui_signaller.h b/src/lib/ui_signaller.h
index 73db8bff8..7e0f57513 100644
--- a/src/lib/ui_signaller.h
+++ b/src/lib/ui_signaller.h
@@ -27,7 +27,7 @@
/** A class to allow signals to be emitted from non-UI threads and handled
* by a UI thread.
*/
-class UISignaller
+class UISignaller : public boost::noncopyable
{
public:
/** Create a UISignaller. Must be called from the UI thread */
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 819333227..4b8941c00 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -73,16 +73,6 @@ VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Nod
}
}
-VideoContent::VideoContent (VideoContent const & o)
- : Content (o)
- , _video_length (o._video_length)
- , _video_size (o._video_size)
- , _video_frame_rate (o._video_frame_rate)
- , _ratio (o._ratio)
-{
-
-}
-
void
VideoContent::as_xml (xmlpp::Node* node) const
{
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index d74242ae9..1c85ca090 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -42,7 +42,6 @@ public:
VideoContent (boost::shared_ptr<const Film>, Time, VideoContent::Frame);
VideoContent (boost::shared_ptr<const Film>, boost::filesystem::path);
VideoContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
- VideoContent (VideoContent const &);
void as_xml (xmlpp::Node *) const;
virtual std::string information () const;
diff --git a/src/lib/writer.h b/src/lib/writer.h
index e56e12e75..1e5d86489 100644
--- a/src/lib/writer.h
+++ b/src/lib/writer.h
@@ -61,7 +61,7 @@ public:
bool operator< (QueueItem const & a, QueueItem const & b);
bool operator== (QueueItem const & a, QueueItem const & b);
-class Writer : public ExceptionStore
+class Writer : public ExceptionStore, public boost::noncopyable
{
public:
Writer (boost::shared_ptr<const Film>, boost::shared_ptr<Job>);