Add some explicit declarations to constructors.
authorCarl Hetherington <cth@carlh.net>
Thu, 2 Jun 2016 09:28:16 +0000 (10:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 2 Jun 2016 09:28:16 +0000 (10:28 +0100)
42 files changed:
src/asset.h
src/asset_reader.h
src/atmos_asset.h
src/certificate.h
src/cpl.h
src/data.h
src/dcp.h
src/encrypted_kdm.cc
src/encrypted_kdm.h
src/exceptions.h
src/file.h
src/font_node.h
src/gamma_transfer_function.h
src/interop_load_font_node.h
src/interop_subtitle_asset.h
src/key.h
src/load_font_node.h
src/local_time.h
src/mono_picture_asset.h
src/mono_picture_asset_reader.h
src/mono_picture_frame.h
src/object.h
src/openjpeg_image.h
src/picture_asset.h
src/reel.h
src/reel_asset.h
src/reel_atmos_asset.h
src/reel_mono_picture_asset.h
src/reel_mxf.h
src/reel_picture_asset.h
src/reel_sound_asset.h
src/reel_stereo_picture_asset.h
src/reel_subtitle_asset.h
src/ref.h
src/smpte_load_font_node.h
src/smpte_subtitle_asset.h
src/sound_asset.h
src/sound_asset_reader.h
src/stereo_picture_asset.h
src/stereo_picture_asset_reader.h
src/subtitle_asset.h
src/types.h

index a67af741296e356b0e103229ef525562dbbf6fb7..c0f4700f9c950676b5c6abe228ad9ffd9a0ed527 100644 (file)
@@ -49,7 +49,7 @@ class Asset : public Object
 {
 public:
        Asset ();
-       Asset (boost::filesystem::path file);
+       explicit Asset (boost::filesystem::path file);
        Asset (std::string id, boost::filesystem::path file);
 
        virtual bool equals (
index e02ab39cea003b9e6055d4f2db5e009eb7f2066b..cfdb468c2f087b8088bd4d2da6814d8d5d0dc024 100644 (file)
@@ -33,7 +33,7 @@ class MXF;
 class AssetReader : public boost::noncopyable
 {
 public:
-       AssetReader (MXF const * mxf);
+       explicit AssetReader (MXF const * mxf);
        virtual ~AssetReader ();
 
 protected:
index 0be12025505e36e2bfc143d4973055db37cb4df5..2a5d09078a8a84bc94cc3c81a2d782f2f925c251 100644 (file)
@@ -28,7 +28,7 @@ namespace dcp {
 class AtmosAsset : public Asset, public MXF
 {
 public:
-       AtmosAsset (boost::filesystem::path file);
+       explicit AtmosAsset (boost::filesystem::path file);
 
        std::string pkl_type (Standard) const;
 
index be6a554ce401a74ce7c3a2751f8e4b97a6d29f73..373d91022e5daf9a0d90cc63d431e4b6ab061471 100644 (file)
@@ -52,8 +52,8 @@ public:
                , _extra_data (false)
        {}
 
-       Certificate (std::string);
-       Certificate (X509 *);
+       explicit Certificate (std::string);
+       explicit Certificate (X509 *);
        Certificate (Certificate const &);
        ~Certificate ();
 
index 952847fe9b6fdf32afb51ef690fb711a4106ad00..a0ad72c53f3747b36787b0dd1621005e06718ee7 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -51,7 +51,7 @@ class CPL : public Asset
 {
 public:
        CPL (std::string annotation_text, ContentKind content_kind);
-       CPL (boost::filesystem::path file);
+       explicit CPL (boost::filesystem::path file);
 
        bool equals (
                boost::shared_ptr<const Asset> other,
index ac260e98396f9b6b7c4e8b1b187f1b7d6cde058b..2481ca4ab86aff7c4061b68bb2821df2fae2d4b6 100644 (file)
@@ -30,10 +30,10 @@ class Data
 {
 public:
        Data ();
-       Data (int size);
+       explicit Data (int size);
        Data (uint8_t const * data, int size);
        Data (boost::shared_array<uint8_t> data, int size);
-       Data (boost::filesystem::path file);
+       explicit Data (boost::filesystem::path file);
 
        virtual ~Data () {}
 
index 16bc60473dc7c87d7e34e81a23efa7b22a03dd2d..3c81b152cf0eaaa0a233af69994aba4e515eba12 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -64,7 +64,7 @@ public:
         *
         *  @param directory Directory containing the DCP's files.
         */
-       DCP (boost::filesystem::path directory);
+       explicit DCP (boost::filesystem::path directory);
 
        typedef std::list<boost::shared_ptr<DCPReadError> > ReadErrors;
 
index 61460b122f557c0a9a3094239644c7919a5838f4..c6ba444faaacfb3fceb5f2b8999a14a3f7522b95 100644 (file)
@@ -46,7 +46,7 @@ class Signer
 public:
        Signer () {}
 
-       Signer (shared_ptr<const cxml::Node> node)
+       explicit Signer (shared_ptr<const cxml::Node> node)
                : x509_issuer_name (node->string_child ("X509IssuerName"))
                , x509_serial_number (node->string_child ("X509SerialNumber"))
        {
@@ -68,7 +68,7 @@ class X509Data
 public:
        X509Data () {}
 
-       X509Data (boost::shared_ptr<const cxml::Node> node)
+       explicit X509Data (boost::shared_ptr<const cxml::Node> node)
                : x509_issuer_serial (Signer (node->node_child ("X509IssuerSerial")))
                , x509_certificate (node->string_child ("X509Certificate"))
        {
@@ -90,11 +90,11 @@ class Reference
 public:
        Reference () {}
 
-       Reference (string u)
+       explicit Reference (string u)
                : uri (u)
        {}
 
-       Reference (shared_ptr<const cxml::Node> node)
+       explicit Reference (shared_ptr<const cxml::Node> node)
                : uri (node->string_attribute ("URI"))
                , digest_value (node->string_child ("DigestValue"))
        {
@@ -120,7 +120,7 @@ public:
                , authenticated_private ("#ID_AuthenticatedPrivate")
        {}
 
-       SignedInfo (shared_ptr<const cxml::Node> node)
+       explicit SignedInfo (shared_ptr<const cxml::Node> node)
        {
                list<shared_ptr<cxml::Node> > references = node->node_children ("Reference");
                for (list<shared_ptr<cxml::Node> >::const_iterator i = references.begin(); i != references.end(); ++i) {
@@ -158,7 +158,7 @@ class Signature
 public:
        Signature () {}
 
-       Signature (shared_ptr<const cxml::Node> node)
+       explicit Signature (shared_ptr<const cxml::Node> node)
                : signed_info (node->node_child ("SignedInfo"))
                , signature_value (node->string_child ("SignatureValue"))
        {
@@ -189,7 +189,7 @@ class AuthenticatedPrivate
 public:
        AuthenticatedPrivate () {}
 
-       AuthenticatedPrivate (shared_ptr<const cxml::Node> node)
+       explicit AuthenticatedPrivate (shared_ptr<const cxml::Node> node)
        {
                list<shared_ptr<cxml::Node> > encrypted_key_nodes = node->node_children ("EncryptedKey");
                for (list<shared_ptr<cxml::Node> >::const_iterator i = encrypted_key_nodes.begin(); i != encrypted_key_nodes.end(); ++i) {
@@ -224,7 +224,7 @@ class TypedKeyId
 public:
        TypedKeyId () {}
 
-       TypedKeyId (shared_ptr<const cxml::Node> node)
+       explicit TypedKeyId (shared_ptr<const cxml::Node> node)
                : key_type (node->string_child ("KeyType"))
                , key_id (remove_urn_uuid (node->string_child ("KeyId")))
        {
@@ -256,7 +256,7 @@ class KeyIdList
 public:
        KeyIdList () {}
 
-       KeyIdList (shared_ptr<const cxml::Node> node)
+       explicit KeyIdList (shared_ptr<const cxml::Node> node)
        {
                list<shared_ptr<cxml::Node> > typed_key_id_nodes = node->node_children ("TypedKeyId");
                for (list<shared_ptr<cxml::Node> >::const_iterator i = typed_key_id_nodes.begin(); i != typed_key_id_nodes.end(); ++i) {
@@ -279,7 +279,7 @@ class AuthorizedDeviceInfo
 public:
        AuthorizedDeviceInfo () {}
 
-       AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
+       explicit AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
                : device_list_identifier (remove_urn_uuid (node->string_child ("DeviceListIdentifier")))
                , device_list_description (node->optional_string_child ("DeviceListDescription"))
        {
@@ -311,7 +311,7 @@ class X509IssuerSerial
 public:
        X509IssuerSerial () {}
 
-       X509IssuerSerial (shared_ptr<const cxml::Node> node)
+       explicit X509IssuerSerial (shared_ptr<const cxml::Node> node)
                : x509_issuer_name (node->string_child ("X509IssuerName"))
                , x509_serial_number (node->string_child ("X509SerialNumber"))
        {
@@ -333,7 +333,7 @@ class Recipient
 public:
        Recipient () {}
 
-       Recipient (shared_ptr<const cxml::Node> node)
+       explicit Recipient (shared_ptr<const cxml::Node> node)
                : x509_issuer_serial (node->node_child ("X509IssuerSerial"))
                , x509_subject_name (node->string_child ("X509SubjectName"))
        {
@@ -355,7 +355,7 @@ class KDMRequiredExtensions
 public:
        KDMRequiredExtensions () {}
 
-       KDMRequiredExtensions (shared_ptr<const cxml::Node> node)
+       explicit KDMRequiredExtensions (shared_ptr<const cxml::Node> node)
                : recipient (node->node_child ("Recipient"))
                , composition_playlist_id (remove_urn_uuid (node->string_child ("CompositionPlaylistId")))
                , content_title_text (node->string_child ("ContentTitleText"))
@@ -402,7 +402,7 @@ class RequiredExtensions
 public:
        RequiredExtensions () {}
 
-       RequiredExtensions (shared_ptr<const cxml::Node> node)
+       explicit RequiredExtensions (shared_ptr<const cxml::Node> node)
                : kdm_required_extensions (node->node_child ("KDMRequiredExtensions"))
        {
 
@@ -426,7 +426,7 @@ public:
                , issue_date (LocalTime().as_string ())
        {}
 
-       AuthenticatedPublic (shared_ptr<const cxml::Node> node)
+       explicit AuthenticatedPublic (shared_ptr<const cxml::Node> node)
                : message_id (remove_urn_uuid (node->string_child ("MessageId")))
                , annotation_text (node->optional_string_child ("AnnotationText"))
                , issue_date (node->string_child ("IssueDate"))
@@ -471,7 +471,7 @@ public:
 
        }
 
-       EncryptedKDMData (shared_ptr<const cxml::Node> node)
+       explicit EncryptedKDMData (shared_ptr<const cxml::Node> node)
                : authenticated_public (node->node_child ("AuthenticatedPublic"))
                , authenticated_private (node->node_child ("AuthenticatedPrivate"))
                , signature (node->node_child ("Signature"))
index 85cd348cfe5e59bacbae50634c71f925d1d5a2b9..d1139d3a668234027921726f968a8559d91c6bae 100644 (file)
@@ -53,7 +53,7 @@ class Certificate;
 class EncryptedKDM
 {
 public:
-       EncryptedKDM (std::string);
+       explicit EncryptedKDM (std::string);
        EncryptedKDM (EncryptedKDM const & kdm);
        EncryptedKDM & operator= (EncryptedKDM const &);
        ~EncryptedKDM ();
index 2f7bc6a946a16d21a6c3f51faaf35b6b80a04668..da75e0b626d111015722502cd3805e73317f83d7 100644 (file)
@@ -71,7 +71,7 @@ public:
 class MiscError : public std::runtime_error
 {
 public:
-       MiscError (std::string message)
+       explicit MiscError (std::string message)
                : std::runtime_error (message)
        {}
 };
@@ -82,7 +82,7 @@ public:
 class DCPReadError : public std::runtime_error
 {
 public:
-       DCPReadError (std::string message)
+       explicit DCPReadError (std::string message)
                : std::runtime_error (message)
        {}
 };
@@ -110,7 +110,7 @@ public:
 class XMLError : public std::runtime_error
 {
 public:
-       XMLError (std::string message)
+       explicit XMLError (std::string message)
                : std::runtime_error (message)
        {}
 };
@@ -121,7 +121,7 @@ public:
 class UnresolvedRefError : public std::runtime_error
 {
 public:
-       UnresolvedRefError (std::string id);
+       explicit UnresolvedRefError (std::string id);
 };
 
 /** @class TimeFormatError
@@ -130,7 +130,7 @@ public:
 class TimeFormatError : public std::runtime_error
 {
 public:
-       TimeFormatError (std::string bad_time);
+       explicit TimeFormatError (std::string bad_time);
 };
 
 /** @class NotEncryptedError
@@ -140,7 +140,7 @@ public:
 class NotEncryptedError : public std::runtime_error
 {
 public:
-       NotEncryptedError (std::string const & what);
+       explicit NotEncryptedError (std::string const & what);
        ~NotEncryptedError () throw () {}
 };
 
index 0f040917e3fcd7dae596fae8a0eaab3e18bf07e3..15767d208ed0b1ce1b6b2b009dcfe618b7c327b8 100644 (file)
@@ -35,7 +35,7 @@ namespace dcp {
 class File : public boost::noncopyable
 {
 public:
-       File (boost::filesystem::path file);
+       explicit File (boost::filesystem::path file);
        ~File ();
 
        uint8_t* data () const {
index de8ca6bcbeb26fe7d2dbe8a01aa211a67f8d3d04..a1e9ab4f0a814aeae2665e9e4130c74bccf930d7 100644 (file)
@@ -41,7 +41,7 @@ public:
        {}
 
        FontNode (cxml::ConstNodePtr node, int tcr, std::string font_id_attribute);
-       FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes);
+       explicit FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes);
 
        std::string text;
        boost::optional<std::string> id;
index 01f2831ac57c9b253715b8d03930ae547e286495..1d17a7c55414f2e780baaf1b21c111ff29f61e0c 100644 (file)
@@ -31,7 +31,7 @@ namespace dcp {
 class GammaTransferFunction : public TransferFunction
 {
 public:
-       GammaTransferFunction (double gamma);
+       explicit GammaTransferFunction (double gamma);
 
        double gamma () const {
                return _gamma;
index ea0b4497b60c67da0b2e68942254908b43c7eec2..86777c6aa8313e4bba30fe467f38766ddcbcd480 100644 (file)
@@ -29,7 +29,7 @@ class InteropLoadFontNode : public LoadFontNode
 public:
        InteropLoadFontNode () {}
        InteropLoadFontNode (std::string id, std::string uri);
-       InteropLoadFontNode (cxml::ConstNodePtr node);
+       explicit InteropLoadFontNode (cxml::ConstNodePtr node);
 
        std::string uri;
 };
index 23ab763039dc5773f96f11fc3d669a889935a2c1..422108fd23a52f8f2fdd987b9148f16f2a032618 100644 (file)
@@ -37,7 +37,7 @@ class InteropSubtitleAsset : public SubtitleAsset
 {
 public:
        InteropSubtitleAsset ();
-       InteropSubtitleAsset (boost::filesystem::path file);
+       explicit InteropSubtitleAsset (boost::filesystem::path file);
 
        bool equals (
                boost::shared_ptr<const Asset>,
index b8cab52245df8fc0d855ca287cedae81057a3010..d8ce5c7f90909a1cc352b5ec1da1d5c63c7eac17 100644 (file)
--- a/src/key.h
+++ b/src/key.h
@@ -39,10 +39,10 @@ public:
        Key ();
 
        /** Create a Key from a raw key value */
-       Key (uint8_t const *);
+       explicit Key (uint8_t const *);
 
        /** Create a Key from a hex key value */
-       Key (std::string);
+       explicit Key (std::string);
 
        Key (Key const &);
        ~Key ();
index 54bdb2f34b5c3fde6710a49b36cbf9c616c96100..1a5c8692af5e835b1279c4cd99c61d52499ad73e 100644 (file)
@@ -32,7 +32,7 @@ class LoadFontNode
 {
 public:
        LoadFontNode () {}
-       LoadFontNode (std::string id_)
+       explicit LoadFontNode (std::string id_)
                : id (id_)
        {}
 
index b298268e4d0e8ea81ae120e82afba5f730521e53..9407aeed5962a586d2b64857e5f80495963c6a7f 100644 (file)
@@ -44,9 +44,9 @@ class LocalTime
 {
 public:
        LocalTime ();
-       LocalTime (boost::posix_time::ptime);
+       explicit LocalTime (boost::posix_time::ptime);
        LocalTime (boost::posix_time::ptime, int tz_hour, int tz_minute);
-       LocalTime (std::string);
+       explicit LocalTime (std::string);
 
        std::string as_string (bool with_millisecond = false) const;
        std::string date () const;
index 09b774e74fcc2e2a0c5f8e9dbeb01a69de08377d..c2079bedc29d9095e17bdad759e848d94498693c 100644 (file)
@@ -36,12 +36,12 @@ public:
        /** Create a MonoPictureAsset by reading a file.
         *  @param file Asset file to read.
         */
-       MonoPictureAsset (boost::filesystem::path file);
+       explicit MonoPictureAsset (boost::filesystem::path file);
 
        /** Create a MonoPictureAsset with a given edit rate.
         *  @param edit_rate Edit rate (i.e. frame rate) in frames per second.
         */
-       MonoPictureAsset (Fraction edit_rate);
+       explicit MonoPictureAsset (Fraction edit_rate);
 
        /** Start a progressive write to a MonoPictureAsset */
        boost::shared_ptr<PictureAssetWriter> start_write (boost::filesystem::path, Standard standard, bool);
index b66c6cbe431e71cd30abcb9b7b757d31c06d6dac..8c1712cbbadb74daa2a4257baf9e51c3795732ee 100644 (file)
@@ -40,7 +40,7 @@ public:
 private:
        friend class MonoPictureAsset;
 
-       MonoPictureAssetReader (MonoPictureAsset const *);
+       explicit MonoPictureAssetReader (MonoPictureAsset const *);
 
        ASDCP::JP2K::MXFReader* _reader;
 };
index efd7f9a95ba88de5d183b22c40cd963a3768f8a9..ec213ac268d283a9db49604f921f3b80d3744b6c 100644 (file)
@@ -47,7 +47,7 @@ class OpenJPEGImage;
 class MonoPictureFrame : public boost::noncopyable
 {
 public:
-       MonoPictureFrame (boost::filesystem::path path);
+       explicit MonoPictureFrame (boost::filesystem::path path);
        MonoPictureFrame (uint8_t const * data, int size);
        ~MonoPictureFrame ();
 
index ff493534888c4a3f989994e3364d14bec75259ce..5c5bbc0e4cab5a7383f9653cf5a9ca49f408ce03 100644 (file)
@@ -39,7 +39,7 @@ class Object : public boost::noncopyable
 {
 public:
        Object ();
-       Object (std::string id);
+       explicit Object (std::string id);
        virtual ~Object () {}
 
        /** @return ID */
index 179ab34659597a469d3f70b391fcc3eed84c951e..3cfa157fff069a6e695d7ad6b745c6687cc70781 100644 (file)
@@ -34,8 +34,8 @@ namespace dcp {
 class OpenJPEGImage : public boost::noncopyable
 {
 public:
-       OpenJPEGImage (opj_image_t *);
-       OpenJPEGImage (Size);
+       explicit OpenJPEGImage (opj_image_t *);
+       explicit OpenJPEGImage (Size);
        ~OpenJPEGImage ();
 
        int* data (int) const;
index 6971d9e18b164082197b87b7447cfd401e6e0c14..9039eceedf8e2304b05c94ff890f7c187f3e1588 100644 (file)
@@ -47,8 +47,8 @@ class PictureAssetWriter;
 class PictureAsset : public Asset, public MXF
 {
 public:
-       PictureAsset (boost::filesystem::path file);
-       PictureAsset (Fraction edit_rate);
+       explicit PictureAsset (boost::filesystem::path file);
+       explicit PictureAsset (Fraction edit_rate);
 
        virtual boost::shared_ptr<PictureAssetWriter> start_write (
                boost::filesystem::path file,
index 8b394861e6e448d541d8ba5d97e75f55064504e7..0c73e69f9f788fb8149f98396670ec508a6f2416 100644 (file)
@@ -63,7 +63,7 @@ public:
                , _atmos (atmos)
        {}
 
-       Reel (boost::shared_ptr<const cxml::Node>);
+       explicit Reel (boost::shared_ptr<const cxml::Node>);
 
        boost::shared_ptr<ReelPictureAsset> main_picture () const {
                return _main_picture;
index eea60fc85cdccf5ff60380b053045b56d2ccbb6a..c2f17d8a7151ccc637634b04219be092b7d1703e 100644 (file)
@@ -53,7 +53,7 @@ class ReelAsset : public Object
 public:
        ReelAsset ();
        ReelAsset (boost::shared_ptr<Asset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
-       ReelAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelAsset (boost::shared_ptr<const cxml::Node>);
 
        virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
        virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const;
index 7d541fcbd17210c02b749fcf32f164d31834ada8..7ce3865f09e0a5a715df303fe231565d926e41f4 100644 (file)
@@ -39,7 +39,7 @@ class ReelAtmosAsset : public ReelAsset, public ReelMXF
 {
 public:
        ReelAtmosAsset (boost::shared_ptr<AtmosAsset> asset, int64_t entry_point);
-       ReelAtmosAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelAtmosAsset (boost::shared_ptr<const cxml::Node>);
 
        boost::shared_ptr<AtmosAsset> asset () const {
                return asset_of_type<AtmosAsset> ();
index e707fc4290829dbe51b167e12578a62d24ecdb92..2b0b40e3a1bf6739fe38e3fa323573479b7ed485 100644 (file)
@@ -39,7 +39,7 @@ class ReelMonoPictureAsset : public ReelPictureAsset
 public:
        ReelMonoPictureAsset ();
        ReelMonoPictureAsset (boost::shared_ptr<MonoPictureAsset> asset, int64_t entry_point);
-       ReelMonoPictureAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelMonoPictureAsset (boost::shared_ptr<const cxml::Node>);
 
        /** @return the MonoPictureAsset that this object refers to */
        boost::shared_ptr<const MonoPictureAsset> mono_asset () const {
index 1d4c3263583435274cd8245c40893e142c6b1f12..b56e293e4acbc5982104ff6da4ac656df3acd5fe 100644 (file)
@@ -41,8 +41,8 @@ class ReelMXF
 {
 public:
        ReelMXF () {}
-       ReelMXF (boost::optional<std::string> key_id);
-       ReelMXF (boost::shared_ptr<const cxml::Node>);
+       explicit ReelMXF (boost::optional<std::string> key_id);
+       explicit ReelMXF (boost::shared_ptr<const cxml::Node>);
        virtual ~ReelMXF () {}
 
        /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */
index 73be1a1a8f864f7058fe4030579d2bf89fdd0b8a..ab93e490a4436979666451644d010af14e3cadb9 100644 (file)
@@ -38,7 +38,7 @@ class ReelPictureAsset : public ReelAsset, public ReelMXF
 public:
        ReelPictureAsset ();
        ReelPictureAsset (boost::shared_ptr<PictureAsset> asset, int64_t entry_point);
-       ReelPictureAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelPictureAsset (boost::shared_ptr<const cxml::Node>);
 
        virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
        virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const;
index f091b1b78e747143e8dac906b6e69973964f2e02..a2716a5186bfe6f237997571195857a4dfcf2fcb 100644 (file)
@@ -36,7 +36,7 @@ class ReelSoundAsset : public ReelAsset, public ReelMXF
 {
 public:
        ReelSoundAsset (boost::shared_ptr<dcp::SoundAsset> content, int64_t entry_point);
-       ReelSoundAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelSoundAsset (boost::shared_ptr<const cxml::Node>);
 
        void write_to_cpl (xmlpp::Node* node, Standard standard) const;
 
index ea95710f393fda7302efa6784d884cba0d42d7bb..a85c10d41540e7f02bb860f2a32e24668e477587 100644 (file)
@@ -39,7 +39,7 @@ class ReelStereoPictureAsset : public ReelPictureAsset
 public:
        ReelStereoPictureAsset ();
        ReelStereoPictureAsset (boost::shared_ptr<StereoPictureAsset> content, int64_t entry_point);
-       ReelStereoPictureAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelStereoPictureAsset (boost::shared_ptr<const cxml::Node>);
 
        /** @return the StereoPictureAsset that this object refers to */
        boost::shared_ptr<const StereoPictureAsset> stereo_asset () const {
index 3eff79c43dded947043666d1edd594a50ffe7960..ee0cf019ae63f070caa72763e15405ed2285e314 100644 (file)
@@ -38,7 +38,7 @@ class ReelSubtitleAsset : public ReelAsset
 {
 public:
        ReelSubtitleAsset (boost::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point);
-       ReelSubtitleAsset (boost::shared_ptr<const cxml::Node>);
+       explicit ReelSubtitleAsset (boost::shared_ptr<const cxml::Node>);
 
        boost::shared_ptr<SubtitleAsset> asset () const {
                return asset_of_type<SubtitleAsset> ();
index 7c8db95fe43ba10e121500560a1e23c2d8808e54..59e83f748fc13018d89085cfbaf4025c4f8aaa2d 100644 (file)
--- a/src/ref.h
+++ b/src/ref.h
@@ -47,12 +47,12 @@ class Ref
 {
 public:
        /** Initialise a Ref with an ID but no shared_ptr */
-       Ref (std::string id)
+       explicit Ref (std::string id)
                : _id (id)
        {}
 
        /** Initialise a Ref with a shared_ptr to an asset */
-       Ref (boost::shared_ptr<Asset> asset)
+       explicit Ref (boost::shared_ptr<Asset> asset)
                : _id (asset->id ())
                , _asset (asset)
        {}
index ff6b752310261be0e3034e5ce1429725b87c4ab7..36c062cee1cd6e5fb5c9b5ae56588b36b27ed05f 100644 (file)
@@ -39,7 +39,7 @@ class SMPTELoadFontNode : public LoadFontNode
 public:
        SMPTELoadFontNode () {}
        SMPTELoadFontNode (std::string id, std::string urn);
-       SMPTELoadFontNode (boost::shared_ptr<const cxml::Node> node);
+       explicit SMPTELoadFontNode (boost::shared_ptr<const cxml::Node> node);
 
        std::string urn;
 };
index 1a609c611386c035b2a3b4de5b08f306f0d77911..664052d6d6f94c485aae08e939e3c74a3111e4e6 100644 (file)
@@ -46,7 +46,7 @@ public:
 
        /** @param file File name
         */
-       SMPTESubtitleAsset (boost::filesystem::path file);
+       explicit SMPTESubtitleAsset (boost::filesystem::path file);
 
        bool equals (
                boost::shared_ptr<const Asset>,
index 952ba968df72bc6d74358da2f7cf313893ffae99..eb357b37a8e8070daed225689fc6b0becb51b676 100644 (file)
@@ -41,7 +41,7 @@ class SoundAssetReader;
 class SoundAsset : public Asset, public MXF
 {
 public:
-       SoundAsset (boost::filesystem::path file);
+       explicit SoundAsset (boost::filesystem::path file);
        SoundAsset (Fraction edit_rate, int sampling_rate, int channels);
 
        boost::shared_ptr<SoundAssetWriter> start_write (boost::filesystem::path file, Standard standard);
index a9a05eb314f6467d173a825c91dde559b483dae4..706f7a9e3fb808338ace355691ac6d2bd976ce36 100644 (file)
@@ -40,7 +40,7 @@ public:
 private:
        friend class SoundAsset;
 
-       SoundAssetReader (SoundAsset const * asset);
+       explicit SoundAssetReader (SoundAsset const * asset);
 
        ASDCP::PCM::MXFReader* _reader;
 };
index 4e56989d57f5cc87fbfbfda94929708b1ed993ac..043fbc9110ed127adcbd76bd1ec560d2d64785bf 100644 (file)
@@ -30,8 +30,8 @@ class StereoPictureAssetReader;
 class StereoPictureAsset : public PictureAsset
 {
 public:
-       StereoPictureAsset (boost::filesystem::path file);
-       StereoPictureAsset (Fraction edit_rate);
+       explicit StereoPictureAsset (boost::filesystem::path file);
+       explicit StereoPictureAsset (Fraction edit_rate);
 
        /** Start a progressive write to a StereoPictureAsset */
        boost::shared_ptr<PictureAssetWriter> start_write (boost::filesystem::path file, Standard, bool);
index 288191e8ccab26ce750a95fd883bc30ee43c1588..363a3eb9cb9b090e63af9960a246d33b34072775 100644 (file)
@@ -40,7 +40,7 @@ public:
 private:
        friend class StereoPictureAsset;
 
-       StereoPictureAssetReader (StereoPictureAsset const *);
+       explicit StereoPictureAssetReader (StereoPictureAsset const *);
 
        ASDCP::JP2K::MXFSReader* _reader;
 };
index 06b144f152e5c594daae0b234c5f8d0b781b773a..dc4c3d83b3535479a5a0ff5d246d75a06ddd2c06 100644 (file)
@@ -56,7 +56,7 @@ class SubtitleAsset : public Asset
 {
 public:
        SubtitleAsset ();
-       SubtitleAsset (boost::filesystem::path file);
+       explicit SubtitleAsset (boost::filesystem::path file);
 
        bool equals (
                boost::shared_ptr<const Asset>,
index 4e42d3aede51417ceff82d94ef6fbd22feef1b2f..26e4bea6b2cbd56da11d8be64ee8294aaf6e4d93 100644 (file)
@@ -140,7 +140,7 @@ class Fraction
 public:
        /** Construct a fraction of 0/0 */
        Fraction () : numerator (0), denominator (0) {}
-       Fraction (std::string s);
+       explicit Fraction (std::string s);
        /** Construct a fraction with a specified numerator and denominator.
         *  @param n Numerator.
         *  @param d Denominator.
@@ -226,7 +226,7 @@ class Colour
 public:
        Colour ();
        Colour (int r_, int g_, int b_);
-       Colour (std::string argb_hex);
+       explicit Colour (std::string argb_hex);
 
        int r; ///< red component, from 0 to 255
        int g; ///< green component, from 0 to 255