Use an enum class for Marker.
[libdcp.git] / src / ref.h
index 7c8db95fe43ba10e121500560a1e23c2d8808e54..94add1c8b58a2cdad495e0595ae4fb1a6b1b060c 100644 (file)
--- a/src/ref.h
+++ b/src/ref.h
 
     You should have received a copy of the GNU General Public License
     along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
+
+    In addition, as a special exception, the copyright holders give
+    permission to link the code of portions of this program with the
+    OpenSSL library under certain conditions as described in each
+    individual source file, and distribute linked combinations
+    including the two.
+
+    You must obey the GNU General Public License in all respects
+    for all of the code used other than OpenSSL.  If you modify
+    file(s) with this exception, you may extend this exception to your
+    version of the file(s), but you are not obligated to do so.  If you
+    do not wish to do so, delete this exception statement from your
+    version.  If you delete this exception statement from all source
+    files in the program, then also delete it here.
 */
 
 /** @file  src/ref.h
@@ -27,7 +41,7 @@
 #include "exceptions.h"
 #include "asset.h"
 #include "util.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
 #include <string>
 
 namespace dcp {
@@ -40,19 +54,19 @@ namespace dcp {
  *  which represents the thing.
  *
  *  If the Ref does not have a shared_ptr it may be given one by
- *  calling resolve() with a list of assets.  The shared_ptr will be
- *  set up using any object on the list which has a matching ID.
+ *  calling resolve() with a vector of assets.  The shared_ptr will be
+ *  set up using any object on the vector which has a matching ID.
  */
 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 (std::shared_ptr<Asset> asset)
                : _id (asset->id ())
                , _asset (asset)
        {}
@@ -63,7 +77,7 @@ public:
                _id = id;
        }
 
-       void resolve (std::list<boost::shared_ptr<Asset> > assets);
+       void resolve (std::vector<std::shared_ptr<Asset>> assets);
 
        /** @return the ID of the thing that we are pointing to */
        std::string id () const {
@@ -73,7 +87,7 @@ public:
        /** @return a shared_ptr to the thing; an UnresolvedRefError is thrown
         *  if the shared_ptr is not known.
         */
-       boost::shared_ptr<Asset> asset () const {
+       std::shared_ptr<Asset> asset () const {
                if (!_asset) {
                        throw UnresolvedRefError (_id);
                }
@@ -99,7 +113,7 @@ public:
 
 private:
        std::string _id;             ///< ID; will always be known
-       boost::shared_ptr<Asset> _asset; ///< shared_ptr to the thing, may be null.
+       std::shared_ptr<Asset> _asset; ///< shared_ptr to the thing, may be null.
 };
 
 }