More noncopyable.
authorCarl Hetherington <cth@carlh.net>
Tue, 16 Jul 2013 21:20:39 +0000 (22:20 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 16 Jul 2013 21:20:39 +0000 (22:20 +0100)
35 files changed:
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/audio_mapping.h
src/lib/config.h
src/lib/content.cc
src/lib/content.h
src/lib/dcp_content_type.h
src/lib/dcp_video_frame.h
src/lib/decoder.h
src/lib/encoder.h
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_content.h
src/lib/ffmpeg_decoder.h
src/lib/film.h
src/lib/filter.h
src/lib/filter_graph.h
src/lib/imagemagick_content.cc
src/lib/imagemagick_content.h
src/lib/job_manager.h
src/lib/log.h
src/lib/player.h
src/lib/playlist.cc
src/lib/playlist.h
src/lib/ratio.h
src/lib/resampler.h
src/lib/scaler.h
src/lib/server.h
src/lib/sndfile_content.cc
src/lib/sndfile_content.h
src/lib/sound_processor.h
src/lib/transcoder.h
src/lib/ui_signaller.h
src/lib/video_content.cc
src/lib/video_content.h
src/lib/writer.h

index e93f348f42359aab632c3d9738c6689200a4a9cf..4814f8244b0af08965091f614974b2cbacf6ab52 100644 (file)
@@ -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
 {
index 9bf53e0ab4d044ac379c6f45decd7d00ba4f932f..239a9dc98a2851e0d2cf38a76c6ce66be1355abd 100644 (file)
@@ -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;
 
index a2de8306bbf376457788bb77884d4a523bbabee0..ed2c3f28d28517eb9aaeb4a13c1380c84a85cf64 100644 (file)
@@ -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;
 
index 38664f093f33d79235c7cdb333ac8333d5196afe..77287e6868a85c0f894708540247d5e099342358 100644 (file)
@@ -40,7 +40,7 @@ class Ratio;
 /** @class Config
  *  @brief A singleton class holding configuration.
  */
-class Config
+class Config : public boost::noncopyable
 {
 public:
 
index 49c579fb618dac4a3672b3568263f8b1b91b6232..b49ea431659bc805ecae527cc5369132bf136127 100644 (file)
@@ -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
 {
index cd8914cba095b88aff3597d6def5cb167a280a1b..a340fb1aaca3034c61e89b84e52204099b884786 100644 (file)
@@ -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 {
index 14204bd722b6d167e5234e09e88eb331b97362ef..965c163478af5fa30eeeefe3b36a1b0522a86d4d 100644 (file)
@@ -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);
index 25a3e99267839237c6710cdcba54aea9a7845e4d..9929b9a8a22ab0b7e0bc796466db5ca02b720b40 100644 (file)
@@ -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>);
index dea4def3a09a510cefd73cd50aa9c0c633a9bf77..6cce9e68d6939b0506900a6a1f888ff7b9481240 100644 (file)
@@ -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>);
index b5a641f50d40492caa008115cf294ea4ec084de5..a6e5932be9d53cb4ed4c3c661d60d91d705139f9 100644 (file)
@@ -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>);
index 487325d71b152245af66534e19537812bae950bd..4c9b1d1662d8eee0bf96abf2aac5adf0adb56fa3 100644 (file)
@@ -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
 {
index dba06990b8567313421691396bf236206b578248..bf550942a952e983878931090f84ad22acb0c0f7 100644 (file)
@@ -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;
index 73edcccb43ec562162825f4e82b3331d9abceaa6..fa318e56828eb9140555c6c6ea72a48b7eab0c57 100644 (file)
@@ -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 ();
index 96ba3eafda7ce7a4b6cd1d9c2bbe80d74339c572..f4065757b2f1bc61a2e53f0e4a6b7fc1ce64a2da 100644 (file)
@@ -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 ();
index 7587312c23dfebf7c2f99167939f3300086270e4..5971cd5cf86e3ebb8da4ee1d8914300b64253e9d 100644 (file)
 
 #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);
index 4942907959d8573d814d56e4d26e303325b67b47..49b78df16949c393b58560b07d52c677ca6c0245 100644 (file)
@@ -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);
index 8e858d0d1b13435f9fb7589d663b7ddc24212960..ae3e1813790ccf409f7b6ff12467dd5dbc8320f6 100644 (file)
@@ -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)
 {
index dab3158e306056909f6c6a23cef2ee0a368f657a..50191cc5ae1e76d4c7980c15dcee47490e44a011 100644 (file)
@@ -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;
index 9c107c19017c82a199499b93f065e3c4ab147b0a..7d58dcfe6d4464af6f669971f12f48dbbedfb870 100644 (file)
@@ -30,7 +30,7 @@ class Job;
 /** @class JobManager
  *  @brief A simple scheduler for jobs.
  */
-class JobManager
+class JobManager : public boost::noncopyable
 {
 public:
 
index 3ad6516c11b7b56ee270c269967bd3d59177e464..bd0066a83baee699582c61febc5c5738dba408eb 100644 (file)
@@ -30,7 +30,7 @@
 /** @class Log
  *  @brief A very simple logging class.
  */
-class Log
+class Log : public boost::noncopyable
 {
 public:
        Log ();
index 2d8eca9b3264909d5e2b452f7b89e0fe7e4f8f94..568c7a7a116d26da36c27b602bd0a40d51f36ce9 100644 (file)
@@ -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>);
index 5aa913bc79c5fcecda3803b534f09c36a3b37020..8c4a7f7d79198174fe1afbc98b12456e4b42ad9c 100644 (file)
@@ -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 ();
index 0b928fe51e46b27378a3aab87284a0221cae920f..5346dd5e7488591d7aabbfb7f722e0946e71c8dd 100644 (file)
@@ -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 *);
index 5480eee124929b9f99239ea536a909a73ffdfe42..c331edabe8104afd54e0ab0a8895aa7cebf5ef91 100644 (file)
 #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)
index 7c85773c000a050d2556b94d38d07ca106922d47..6e282838a17c5f98e8ae707d0059ab74e1c1bfe4 100644 (file)
 */
 
 #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);
index a736e92de0a269b37821fa51b725845c4872bca3..6a039edd8d037878503ea79fdf971c5e2d1eb782 100644 (file)
 
 #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);
index 398401a555dd1eff784ad1d2289677e5258660f2..e6d3743691e09cc2b3054300e8683031b5534ea1 100644 (file)
@@ -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);
index beee7cd9d0aa33c37dfa31d789b4ef076d3eacfa..2dd7d8f67648b5b97a067cb9ea17484aa64d3614 100644 (file)
@@ -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)
 {
index e3b775e8bad9eda6674065ce0a903e22c3bf6259..87350eac70d13314f0721128564e25466465bd46 100644 (file)
@@ -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 */
index bdbe72ba2798b689a7f2aec5b3205f0c788cba2b..8f265224372ceeae9eb8e9f0d2884e4e434bd036 100644 (file)
 
 #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);
index b3c8f888b1106dfd4ffb6753ae247672ded2fff4..007065b658cd7240f15001f1361f549aa1378493 100644 (file)
@@ -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 (
index 73db8bff85d1b67b78c5e5c4704322ad1acc5528..7e0f575135fc893681cc08e3b481847d112c3824 100644 (file)
@@ -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 */
index 819333227a6e42c4a52d41a807cb338ddce45f48..4b8941c0032c612891417228a86db310c56d7730 100644 (file)
@@ -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
 {
index d74242ae9c46779801bd4a8415d509610725f8ca..1c85ca09088b5547f386ca1c7bb5c874ab564225 100644 (file)
@@ -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;
index e56e12e75a2255ac95bab0b1563733f3a5521e94..1e5d864898e8457380ce5622520b7579f8141da5 100644 (file)
@@ -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>);