Make ::swap virtual.
[libdcp.git] / src / asset.cc
index e55dca2dab05999c58d9c65d93efe330f9c1acf0..7e60ecc5300dfc80af79c8a524c5193a887b650e 100644 (file)
@@ -25,6 +25,7 @@
 #include "asset.h"
 #include "util.h"
 #include "exceptions.h"
+#include "dcp_assert.h"
 #include "compose.hpp"
 #include <libxml++/libxml++.h>
 
@@ -48,19 +49,10 @@ Asset::Asset (boost::filesystem::path file)
 
 }
 
-/** Create an Asset with a specified ID.
- *  @param id ID to use.
- */
-Asset::Asset (string id)
-       : Object (id)
-{
-
-}
-
 void
 Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const
 {
-       assert (!_file.empty ());
+       DCP_ASSERT (!_file.empty ());
        
        xmlpp::Node* asset = node->add_child ("Asset");
        asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
@@ -73,7 +65,7 @@ Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const
 void
 Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
 {
-       assert (!_file.empty ());
+       DCP_ASSERT (!_file.empty ());
 
        xmlpp::Node* asset = node->add_child ("Asset");
        asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
@@ -92,7 +84,7 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
 string
 Asset::hash (function<void (float)> progress) const
 {
-       assert (!_file.empty ());
+       DCP_ASSERT (!_file.empty ());
                
        if (_hash.empty ()) {
                _hash = make_digest (_file, progress);
@@ -102,10 +94,10 @@ Asset::hash (function<void (float)> progress) const
 }
 
 bool
-Asset::equals (boost::shared_ptr<const Asset> other, EqualityOptions, function<void (NoteType, string)> note) const
+Asset::equals (boost::shared_ptr<const Asset> other, EqualityOptions, NoteHandler note) const
 {
        if (_hash != other->_hash) {
-               note (DCP_ERROR, "Asset hashes differ");
+               note (DCP_ERROR, "Asset: hashes differ");
                return false;
        }