libdcp
|
A reference to an asset which is identified by a universally-unique identifier (UUID) More...
#include <ref.h>
Public Member Functions | |
Ref (std::string id) | |
Ref (std::shared_ptr< Asset > asset) | |
void | set_id (std::string id) |
void | resolve (std::vector< std::shared_ptr< Asset >> assets) |
std::string | id () const |
std::shared_ptr< Asset > | asset () const |
Asset * | operator-> () const |
bool | resolved () const |
Private Attributes | |
std::string | _id |
ID; will always be known. | |
std::shared_ptr< Asset > | _asset |
shared_ptr to the thing, may be null. | |
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 which represents the thing.
If the Ref does not have a shared_ptr it may be given one by 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.
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
operator-> to access the shared_ptr; an UnresolvedRefError is thrown if the shared_ptr is not known
void Ref::resolve | ( | std::vector< std::shared_ptr< Asset >> | assets | ) |
|
inline |
|
inline |