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
#include "exceptions.h"
#include "asset.h"
#include "util.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
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)
{}
_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 {
/** @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);
}
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.
};
}