#include <assets.h>
An AssetLink is a symbolic link to an asset identified by its id and version. Also an ASSET_UPDATE_POLICY is stored to control the behavior of the link when newer versions of the linked asset exists.
Alternatively an AssetLink can also just wrap a Url from which an asset can be loaded directly.
Public Member Functions | |
MAXON_METHOD const Url & | GetUrl () const |
MAXON_METHOD Result< AssetDescription > | Resolve (const AssetRepositoryRef &context) const |
MAXON_METHOD ASSET_UPDATE_POLICY | GetUpdatePolicy () const |
MAXON_METHOD void | SetUpdatePolicy (ASSET_UPDATE_POLICY up) |
Static Public Member Functions | |
static MAXON_METHOD Result< AssetLink > | Create (const Id &type, const IdAndVersion &aid, ASSET_UPDATE_POLICY up) |
static MAXON_METHOD Result< AssetLink > | Create (const Id &type, const Url &url) |
Private Member Functions | |
MAXON_INTERFACE (AssetLinkInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.interface.assetlink") | |
Private Attributes | |
MAXON_INTERFACE_SINGLE_IMPLEMENTATION | |
|
private |
|
static |
Creates a new AssetLink for the given asset and update policy.
[in] | type | The expected type of the asset. |
[in] | aid | Identifier and version of the asset. |
[in] | up | The update policy which the created link shall use. |
|
static |
MAXON_METHOD const Url& GetUrl | ( | ) | const |
MAXON_METHOD Result<AssetDescription> Resolve | ( | const AssetRepositoryRef & | context | ) | const |
Resolves this AssetLink to an AssetDescription in the given context. The asset identifier of this link is used to find the asset in context, and if this link uses the policy ASSET_UPDATE_POLICY::IMPLICIT the latest version of the asset is used, otherwise the version recorded in this link.
[in] | context | The repository to use for the asset lookup. |
MAXON_METHOD ASSET_UPDATE_POLICY GetUpdatePolicy | ( | ) | const |
Returns the update policy which this link uses.
MAXON_METHOD void SetUpdatePolicy | ( | ASSET_UPDATE_POLICY | up | ) |
Sets the update policy for this link.
[in] | up | The new update policy for this link. |
|
private |