From 6c37cc1979b2a01205a888c4c98f3334685ee8dd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Jan 2021 15:35:24 +0100 Subject: Tidying. --- src/ref.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/ref.h') diff --git a/src/ref.h b/src/ref.h index 94add1c8..d306f963 100644 --- a/src/ref.h +++ b/src/ref.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of libdcp. @@ -31,23 +31,28 @@ files in the program, then also delete it here. */ + /** @file src/ref.h - * @brief Ref class. + * @brief Ref class */ + #ifndef LIBDCP_REF_H #define LIBDCP_REF_H + #include "exceptions.h" #include "asset.h" #include "util.h" #include #include + namespace dcp { + /** @class Ref - * @brief A reference to an asset which is identified by a universally-unique identifier (UUID). + * @brief A reference to an asset which is identified by a universally-unique identifier (UUID) * * This class is a `pointer' to a thing. It will always know the * UUID of the thing, and it may have a shared_ptr to the C++ object @@ -77,6 +82,9 @@ public: _id = id; } + /** Look through a list of assets and copy a shared_ptr to any asset + * which matches the ID of this one + */ void resolve (std::vector> assets); /** @return the ID of the thing that we are pointing to */ @@ -85,7 +93,7 @@ public: } /** @return a shared_ptr to the thing; an UnresolvedRefError is thrown - * if the shared_ptr is not known. + * if the shared_ptr is not known */ std::shared_ptr asset () const { if (!_asset) { @@ -96,7 +104,7 @@ public: } /** operator-> to access the shared_ptr; an UnresolvedRefError is thrown - * if the shared_ptr is not known. + * if the shared_ptr is not known */ Asset * operator->() const { if (!_asset) { @@ -116,6 +124,8 @@ private: std::shared_ptr _asset; ///< shared_ptr to the thing, may be null. }; + } + #endif -- cgit v1.2.3