#include <assets.h>
An AssetRepositoryInterface manages a set of assets:
An asset repository can have several base repositories which are used for the lookup after lookup in the repository itself has finished. Cycles aren't allowed, so asset repositories form a directed acyclic graph.
A repository which has another repository as (direct or indirect) base is said to be /derived/ from that repository. Whenever an observable of a repository is triggered, this is done for all derived repositories too.
The methods of AssetRepositoryInterface are thread-safe. This allows for concurrent modifications and queries.
Public Types | |
using | LatestAssetMap = HashMap< Id, AssetDescription > |
Public Member Functions | |
MAXON_METHOD const Id & | GetId () const |
MAXON_METHOD Array< AssetRepositoryRef > | GetBases () const |
MAXON_METHOD Result< Bool > | GetDerived (const ValueReceiver< const AssetRepositoryRef & > &receiver) const |
MAXON_METHOD Result< void > | InitBases (const Block< const AssetRepositoryRef > &bases) |
MAXON_METHOD Result< void > | AddBase (const AssetRepositoryRef &base) |
MAXON_METHOD Result< void > | RemoveBase (const AssetRepositoryRef &base) |
MAXON_METHOD AssetRepositoryRef | FindRepository (const Id &repoId) const |
MAXON_FUNCTION Bool | IsBasedOnOrSame (const AssetRepositoryRef &other) const |
MAXON_FUNCTION Bool | IsBasedOnOrSame (const Id &other) const |
MAXON_METHOD Bool | IsWritable () const |
MAXON_METHOD Result< Bool > | PrivateFindAssets (const Block< const Id > &types, const Id &aid, const Id &version, ASSET_FIND_MODE findMode, const ValueReceiver< const AssetDescription & > &assets, HashSet< const AssetRepositoryInterface * > &visited, LatestAssetMap &latestMap) const |
MAXON_METHOD Result< void > | PrivatePrefetchMetaData (const InternedId &metaId, AssetMetaDataInterface::KIND kind, ASSET_FIND_MODE findMode, HashSet< const AssetRepositoryInterface * > &visited) |
MAXON_FUNCTION Result< Bool > | FindAssets (const Id &type, const Id &aid, const Id &version, ASSET_FIND_MODE findMode, const ValueReceiver< const AssetDescription & > &receiver) const |
MAXON_FUNCTION Result< Bool > | FindAssets (const AssetType &type, const Id &aid, const Id &version, ASSET_FIND_MODE findMode, const ValueReceiver< const AssetDescription & > &receiver) const |
MAXON_METHOD Result< Bool > | FindAssets (const Block< const Id > &types, const Id &aid, const Id &version, ASSET_FIND_MODE findMode, const ValueReceiver< const AssetDescription & > &receiver) const |
MAXON_METHOD Result< AssetDescription > | FindLatestAsset (const Id &type, const Id &aid, const Id &version, ASSET_FIND_MODE findMode=ASSET_FIND_MODE::NONE) const |
MAXON_FUNCTION Result< AssetDescription > | FindLatestAsset (const AssetType &type, const Id &aid, const Id &version, ASSET_FIND_MODE findMode=ASSET_FIND_MODE::NONE) const |
MAXON_METHOD Result< AssetDescription > | GetDescription (const Asset &asset) const |
MAXON_METHOD COMPARERESULT | CompareVersions (const AssetBase &first, const AssetBase &second) const |
MAXON_METHOD Result< AssetDescription > | StoreAsset (const Id &aid, Asset &asset, const AssetMetaData &metaData=GetZeroRef< AssetMetaData >()) |
template<typename ASSET , typename = typename std::enable_if<maxon::HasBaseDetector<typename ASSET::ReferencedType, AssetInterface>::value>::type> | |
MAXON_FUNCTION Result< AssetDescription > | StoreAsset (const Id &aid, ASSET &asset, const AssetMetaData &metaData=GetZeroRef< AssetMetaData >()) |
MAXON_METHOD Result< AssetDescription > | OverwriteAsset (const Id &aid, Asset &asset, const AssetMetaData &metaData=GetZeroRef< AssetMetaData >()) |
template<typename ASSET , typename = typename std::enable_if<maxon::HasBaseDetector<typename ASSET::ReferencedType, AssetInterface>::value>::type> | |
MAXON_FUNCTION Result< AssetDescription > | OverwriteAsset (const Id &aid, ASSET &asset, const AssetMetaData &metaData=GetZeroRef< AssetMetaData >()) |
MAXON_METHOD Result< AssetDescription > | DeleteAsset (const Id &aid) |
MAXON_METHOD Result< void > | EraseAsset (const AssetDescription &asset) |
MAXON_METHOD Result< AssetDescription > | CopyAsset (const Id &aid, const AssetDescription &source, Bool addEncryption=false, Bool overwrite=false) |
MAXON_METHOD Result< void > | StoreMetaData (const AssetDescription &asset, const InternedId &metaId, ForwardingDataPtr &&data, AssetMetaDataInterface::KIND kind) |
MAXON_METHOD Result< void > | StoreUrlMetaData (const AssetDescription &asset, const InternedId &metaId, const Url &source, AssetMetaDataInterface::KIND kind) |
MAXON_OBSERVABLE (void, ObservableBaseChanged,(const AssetRepositoryRef &base, Bool added), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (void, ObservableAssetStored,(const AssetDescription &asset), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (void, ObservableAssetErased,(const AssetDescription &asset), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (void, ObservableAssetUpdated,(const Asset &asset), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (void, ObservableMetaDataStored,(const AssetDescription &asset, const InternedId &metaId, AssetMetaDataInterface::KIND kind, const Data &prevData, const Data &newData), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (void, ObservableDownloadStateChanged,(const AssetRepositoryRef &repository, Bool finished), ObservableCombinerRunAllComponent) | |
MAXON_METHOD Result< const GenericData & > | GetCachedData (MoveDataPtr &&key, const Delegate< Result< GenericData >()> &callback) |
MAXON_METHOD Result< Id > | GetDescriptionDatabaseId () const |
MAXON_METHOD Result< DataDescription > | LoadDescription (const Id &category, const LanguageRef &language, const AssetDescription &asset) |
MAXON_METHOD Result< DataDescription > | LoadDescription (const Id &category, const LanguageRef &language, const IdAndVersion &dataType) |
MAXON_FUNCTION Result< DataDescription > | LoadDescription (const Id &category, const LanguageRef &language, const Id &dataType) |
MAXON_METHOD Result< DataDescriptionDefinition > | LoadDescriptionDefinition (LOADDESCRIPTIONMODE mode, const Id &category, const LanguageRef &language, const AssetDescription &asset) |
MAXON_METHOD Result< String > | GetRepositoryName (const LanguageRef &language, Bool addDetails) const |
MAXON_METHOD Result< void > | SetRepositoryName (const String &name, const LanguageRef &language) |
MAXON_METHOD Result< const DerivedAssetRepositoryDataRef & > | GetCachedData (MoveDataPtr &&key, const Delegate< Result< DerivedAssetRepositoryDataRef >()> &callback) |
MAXON_METHOD void | HandleDownloadStateChanged (const AssetRepositoryRef &repository, Bool finished) |
MAXON_METHOD void | RequestUnloadRepository () |
template<typename ASSET , typename > | |
Result< AssetDescription > | StoreAsset (const Id &aid, ASSET &asset, const AssetMetaData &metaData) |
template<typename ASSET , typename > | |
Result< AssetDescription > | OverwriteAsset (const Id &aid, ASSET &asset, const AssetMetaData &metaData) |
Protected Member Functions | |
MAXON_METHOD void | HandleBaseChanged (const AssetRepositoryRef &base, Bool added) |
MAXON_METHOD void | HandleAssetStored (const AssetDescription &asset) |
MAXON_METHOD void | HandleAssetErased (const AssetDescription &asset) |
MAXON_METHOD void | HandleAssetUpdated (const Asset &asset) |
MAXON_METHOD void | HandleMetaDataStored (const AssetDescription &asset, const InternedId &metaId, AssetMetaDataInterface::KIND kind, const Data &prevData, const Data &newData) |
Private Member Functions | |
MAXON_INTERFACE (AssetRepositoryInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.assetrepository") | |
Private Member Functions inherited from DataDictionaryObjectInterface | |
MAXON_METHOD Result< void > | SetData (ForwardingDataPtr &&key, Data &&data) |
MAXON_FUNCTION Result< void > | SetData (ForwardingDataPtr &&key, const Data &data) |
MAXON_METHOD Result< Data > | GetData (const ConstDataPtr &key) const |
template<typename KEY > | |
MAXON_FUNCTION Bool | Contains (KEY &&key) const |
MAXON_METHOD Result< void > | EraseData (const ConstDataPtr &key) |
MAXON_METHOD void | Reset () |
MAXON_METHOD Bool | IsEmpty () const |
MAXON_FUNCTION Bool | IsPopulated () const |
template<typename REFCLASS , typename T = void, typename KEY > | |
MAXON_FUNCTION Result< typename std::conditional< std::is_void< T >::value, typename IsFidClass< KEY >::type, T >::type > | Get (KEY &&key) const |
template<typename REFCLASS , typename T , typename KEY > | |
MAXON_FUNCTION std::conditional< IsFidClass< KEY >::value &&GetCollectionKind< T >::value !=COLLECTION_KIND::ARRAY, typename IsFidClass< KEY >::type, T >::type | Get (KEY &&key, const T &defaultValue) const |
template<typename REFCLASS , typename T , typename KEY > | |
MAXON_FUNCTION std::conditional< IsFidClass< KEY >::value &&GetCollectionKind< T >::value !=COLLECTION_KIND::ARRAY, typename IsFidClass< KEY >::type, T >::type | Get (KEY &&key, T &&defaultValue) const |
template<typename T = void, typename KEY > | |
MAXON_FUNCTION std::conditional< std::is_void< T >::value, typename IsFidClass< KEY >::type, T >::type | GetOrDefault (KEY &&key) const |
template<typename REFCLASS , typename T , typename KEY > | |
MAXON_FUNCTION Result< void > | Set (KEY &&key, T &&data) |
template<typename REFCLASS , typename KEY > | |
MAXON_FUNCTION Result< void > | Erase (KEY &&key) |
MAXON_METHOD void | InitIterator (DataDictionaryIteratorInterface *iterator, Bool end) const |
MAXON_FUNCTION ConstIterator | Begin () const |
MAXON_FUNCTION ConstIterator | End () const |
template<typename T , typename KEY > | |
std::conditional< std::is_void< T >::value, typename IsFidClass< KEY >::type, T >::type | GetOrDefault (KEY &&key) const |
Additional Inherited Members | |
Private Types inherited from DataDictionaryObjectInterface | |
using | Iterator = DataDictionaryIterator |
using | ConstIterator = DataDictionaryIterator |
using LatestAssetMap = HashMap<Id, AssetDescription> |
|
private |
MAXON_METHOD const Id& GetId | ( | ) | const |
Returns the identifier of this repository. Repository identifiers needn't be unique, but a repository must not have the same identifier as one of its (direct or indirect) bases.
MAXON_METHOD Array<AssetRepositoryRef> GetBases | ( | ) | const |
Returns an array holding all current base repositories of this repository. but a repository must not have the same identifier as one of its (direct or indirect) bases.
MAXON_METHOD Result<Bool> GetDerived | ( | const ValueReceiver< const AssetRepositoryRef & > & | receiver | ) | const |
Yields all derived repositories of this repository to #receiver (those which have this repository as direct base).
[in] | receiver | The receiver for derived repositories. |
MAXON_METHOD Result<void> InitBases | ( | const Block< const AssetRepositoryRef > & | bases | ) |
Initializes the base repositories of this repository. This function may only be called once right after the AssetRepositoryInterface instance has been created. It doesn't inform any observers.
[in] | bases | The bases of this repository. |
MAXON_METHOD Result<void> AddBase | ( | const AssetRepositoryRef & | base | ) |
Adds base to the list of base repositories of this repository. The observers for ObservableBaseChanged of this repository and its derived repositories are informed.
[in] | base | The base repository to add. |
MAXON_METHOD Result<void> RemoveBase | ( | const AssetRepositoryRef & | base | ) |
MAXON_METHOD AssetRepositoryRef FindRepository | ( | const Id & | repoId | ) | const |
Finds the repository with the given identifier among this repository and its direct and indirect bases. If no such repository exists, a null reference is returned.
[in] | repoId | The identifier of the repository to find. |
MAXON_FUNCTION Bool IsBasedOnOrSame | ( | const AssetRepositoryRef & | other | ) | const |
MAXON_FUNCTION Bool IsBasedOnOrSame | ( | const Id & | other | ) | const |
Returns true if this repository is based a repository with identifier other or has that identifier itself, false otherwise.
[in] | other | A repository identifier. |
MAXON_METHOD Bool IsWritable | ( | ) | const |
Tells if this repository is writable or not.
MAXON_METHOD Result<Bool> PrivateFindAssets | ( | const Block< const Id > & | types, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode, | ||
const ValueReceiver< const AssetDescription & > & | assets, | ||
HashSet< const AssetRepositoryInterface * > & | visited, | ||
LatestAssetMap & | latestMap | ||
) | const |
MAXON_METHOD Result<void> PrivatePrefetchMetaData | ( | const InternedId & | metaId, |
AssetMetaDataInterface::KIND | kind, | ||
ASSET_FIND_MODE | findMode, | ||
HashSet< const AssetRepositoryInterface * > & | visited | ||
) |
PrivatePrefetchMetaData prefetches all meta data of the given type.
[in] | metaId | MetaData id to prefetch. |
[in] | findMode | see ASSET_FIND_MODE. |
[in] | visited | temp Hashmap. |
MAXON_FUNCTION Result<Bool> FindAssets | ( | const Id & | type, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode, | ||
const ValueReceiver< const AssetDescription & > & | receiver | ||
) | const |
Finds all assets matching the parameters:
When version is given or ASSET_FIND_MODE::LATEST is used and a matching asset is found in a repository, assets in base repositories thereof aren't reported even if they are newer. So then an asset in a repository hides assets with the same identifier in base repositories. Assets with another identifier are still reported.
[in] | type | The allowed asset type. |
[in] | aid | The asset identifier to lookup, use an empty identifier to find all assets. |
[in] | version | The version identifier to find, use an empty identifier to find all versions. |
[in] | findMode | Flags for the lookup. |
[in] | receiver | All found assets are reported to this receiver. |
Result< Bool > FindAssets | ( | const AssetType & | type, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode, | ||
const ValueReceiver< const AssetDescription & > & | receiver | ||
) | const |
Finds all assets matching the parameters:
When version is given or ASSET_FIND_MODE::LATEST is used and a matching asset is found in a repository, assets in base repositories thereof aren't reported even if they are newer. So then an asset in a repository hides assets with the same identifier in base repositories. Assets with another identifier are still reported.
[in] | type | The allowed asset type. |
[in] | aid | The asset identifier to lookup, use an empty identifier to find all assets. |
[in] | version | The version identifier to find, use an empty identifier to find all versions. |
[in] | findMode | Flags for the lookup. |
[in] | receiver | All found assets are reported to this receiver. |
MAXON_METHOD Result<Bool> FindAssets | ( | const Block< const Id > & | types, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode, | ||
const ValueReceiver< const AssetDescription & > & | receiver | ||
) | const |
Finds all assets matching the parameters:
When version is given or ASSET_FIND_MODE::LATEST is used and a matching asset is found in a repository, assets in base repositories thereof aren't reported even if they are newer. So then an asset in a repository hides assets with the same identifier in base repositories. Assets with another identifier are still reported.
[in] | types | The allowed asset types. |
[in] | aid | The asset identifier to lookup, use an empty identifier to find all assets. |
[in] | version | The version identifier to find, use an empty identifier to find all versions. |
[in] | findMode | Flags for the lookup. |
[in] | receiver | All found assets are reported to this receiver. |
MAXON_METHOD Result<AssetDescription> FindLatestAsset | ( | const Id & | type, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode = ASSET_FIND_MODE::NONE |
||
) | const |
Finds the asset with the given identifier in this repository and its base repositories. If version is set, this finds the asset with that version, otherwise it finds the latest asset. When a matching asset is found in a repository, assets in base repositories thereof aren't considered even if they are newer.
[in] | type | The allowed asset type. |
[in] | aid | The asset identifier to lookup. |
[in] | version | The version identifier to find, use an empty identifier to find the latest version. |
[in] | findMode | Flags for the lookup, only ASSET_FIND_MODE::WITHOUT_BASES and ASSET_FIND_MODE::WITH_DELETED make sense for this method. |
Result< AssetDescription > FindLatestAsset | ( | const AssetType & | type, |
const Id & | aid, | ||
const Id & | version, | ||
ASSET_FIND_MODE | findMode = ASSET_FIND_MODE::NONE |
||
) | const |
Finds the asset with the given identifier in this repository and its base repositories. If version is set, this finds the asset with that version, otherwise it finds the latest asset. When a matching asset is found in a repository, assets in base repositories thereof aren't considered even if they are newer.
[in] | type | The allowed asset type. |
[in] | aid | The asset identifier to lookup. |
[in] | version | The version identifier to find, use an empty identifier to find the latest version. |
[in] | findMode | Flags for the lookup, only ASSET_FIND_MODE::WITHOUT_BASES and ASSET_FIND_MODE::WITH_DELETED make sense for this method. |
MAXON_METHOD Result<AssetDescription> GetDescription | ( | const Asset & | asset | ) | const |
GetDescription returns the AssetDescription of the given asset.
[in] | asset | Asset to query. |
MAXON_METHOD COMPARERESULT CompareVersions | ( | const AssetBase & | first, |
const AssetBase & | second | ||
) | const |
Compares the versions of assets of this repository:
Being newer isn't based on the time stamp, but on the order in which assets are stored. It also takes into account the update counter (AssetInterface::GetUpdate) when both assets have the same version identifier.
If both assets have different asset identifiers the method returns COMPARERESULT::INCOMPARABLE. If the assets don't belong to this repository, the result is unspecified.
[in] | first | The first asset. |
[in] | second | The second asset. |
MAXON_METHOD Result<AssetDescription> StoreAsset | ( | const Id & | aid, |
Asset & | asset, | ||
const AssetMetaData & | metaData = GetZeroRef< AssetMetaData >() |
||
) |
Stores asset as a new version using the identifier #aid. Identifier, version and repository are set correspondingly at #asset, so #asset may point to a copy of the original object afterwards (Asset is a copy-on-write reference).
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset identifier to use. |
[in,out] | asset | The asset object to store. This method sets identifier, version and repository of #asset. |
[in] | metaData | Initial meta data to use for the asset. |
MAXON_FUNCTION Result<AssetDescription> StoreAsset | ( | const Id & | aid, |
ASSET & | asset, | ||
const AssetMetaData & | metaData = GetZeroRef< AssetMetaData >() |
||
) |
Stores asset as a new version using the identifier #aid. Identifier, version and repository are set correspondingly at #asset, so #asset may point to a copy of the original object afterwards (Asset is a copy-on-write reference).
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset identifier to use. |
[in,out] | asset | The asset object to store. This method sets identifier, version and repository of #asset. |
[in] | metaData | Initial meta data to use for the asset. |
MAXON_METHOD Result<AssetDescription> OverwriteAsset | ( | const Id & | aid, |
Asset & | asset, | ||
const AssetMetaData & | metaData = GetZeroRef< AssetMetaData >() |
||
) |
Stores asset as a new version using the identifier #aid. Identifier, version and repository are set correspondingly at #asset, so #asset may point to a copy of the original object afterwards (Asset is a copy-on-write reference).
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset identifier to use. |
[in,out] | asset | The asset object to store. This method sets identifier, version and repository of #asset. |
[in] | metaData | Initial meta data to use for the asset. |
MAXON_FUNCTION Result<AssetDescription> OverwriteAsset | ( | const Id & | aid, |
ASSET & | asset, | ||
const AssetMetaData & | metaData = GetZeroRef< AssetMetaData >() |
||
) |
Stores asset as a new version using the identifier #aid. Identifier, version and repository are set correspondingly at #asset, so #asset may point to a copy of the original object afterwards (Asset is a copy-on-write reference).
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset identifier to use. |
[in,out] | asset | The asset object to store. This method sets identifier, version and repository of #asset. |
[in] | metaData | Initial meta data to use for the asset. |
MAXON_METHOD Result<AssetDescription> DeleteAsset | ( | const Id & | aid | ) |
Deletes the asset given by the identifier #aid. The previous versions still exist in the repository, this method just stores a delete marker so that FindAssets doesn't take those versions into account unless the ASSET_FIND_MODE::WITH_DELETED flag is given. For a complete removal of a specific version use EraseAsset.
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset to delete. |
MAXON_METHOD Result<void> EraseAsset | ( | const AssetDescription & | asset | ) |
Permanently erases an asset version. Unlike DeleteAsset which marks an asset as deleted but keeps all previous versions this method completely removes any data of the given asset version.
Observers of ObservableAssetErased of this repository and its derived repositories are informed.
[in] | asset | The asset version to erase from this repository. |
MAXON_METHOD Result<AssetDescription> CopyAsset | ( | const Id & | aid, |
const AssetDescription & | source, | ||
Bool | addEncryption = false , |
||
Bool | overwrite = false |
||
) |
Copies an asset including meta data to this repository using the identifier #aid for the copy. source has to be an asset already stored in some repository. The version identifier of source will be used for the copy even if this repository would normally derive a different identifier from the asset content.
Observers of ObservableAssetStored of this repository and its derived repositories are informed.
[in] | aid | The asset identifier to use. |
[in] | source | The source asset to copy. |
[in] | addEncryption | True if the copy shall be stored in an encrypted way. The encryption has to be handled by the AssetType. |
[in] | overwrite | True to overwrite the existing asset. |
MAXON_METHOD Result<void> StoreMetaData | ( | const AssetDescription & | asset, |
const InternedId & | metaId, | ||
ForwardingDataPtr && | data, | ||
AssetMetaDataInterface::KIND | kind | ||
) |
Stores #data for the meta data attribute #metaId of the given #asset. Observers of ObservableMetaDataStored of this repository and its derived repositories are informed.
[in] | asset | The asset for which a meta data value shall be set. |
[in] | metaId | The identifier of the meta data attribute. |
[in] | data | The value to set. |
[in] | kind | The kind of the meta data. |
MAXON_METHOD Result<void> StoreUrlMetaData | ( | const AssetDescription & | asset, |
const InternedId & | metaId, | ||
const Url & | source, | ||
AssetMetaDataInterface::KIND | kind | ||
) |
Copies the file or directory source as meta data for the meta data attribute #metaId of the given #asset. The value of the meta data attribute will be a Url which points to the local copy within the asset (i.e., not to source) of the form {meta:///assetid/metaid.kind.extension}, so the file name extension of source gets preserved. Observers of ObservableMetaDataStored of this repository and its derived repositories are informed.
[in] | asset | The asset for which a meta data value shall be set. |
[in] | metaId | The identifier of the meta data attribute. |
[in] | source | The source which shall be copied as meta data to #asset. Pass empty Url to remove the meta data. |
[in] | kind | The kind of the meta data. |
MAXON_OBSERVABLE | ( | void | , |
ObservableBaseChanged | , | ||
(const AssetRepositoryRef &base, Bool added) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the addition or removal of a base repository via AddBase and RemoveBase. The observers are called not only when this happens for this repository itself, but also when it happens for one of its base repositories.
[in] | base | The base repository. |
[in] | added | True if base has been added, false if it has been removed. |
MAXON_OBSERVABLE | ( | void | , |
ObservableAssetStored | , | ||
(const AssetDescription &asset) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the storage of a new asset version. This includes StoreAsset and CopyAsset, but also the storage of a delete marker via DeleteAsset. The observers are called not only when this happens for this repository itself, but also when it happens for one of its base repositories.
[in] | asset | The description of the new asset version. |
MAXON_OBSERVABLE | ( | void | , |
ObservableAssetErased | , | ||
(const AssetDescription &asset) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the erasure of an asset version, see EraseAsset. The observers are called not only when this happens for this repository itself, but also when it happens for one of its base repositories.
[in] | asset | The description of the erased asset version. |
MAXON_OBSERVABLE | ( | void | , |
ObservableAssetUpdated | , | ||
(const Asset &asset) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the update of an asset. An update happens when the asset uses references to other assets and those references are updated to newer versions of the referenced assets. No new asset version is created. The observers are called not only when this happens for this repository itself, but also when it happens for one of its base repositories.
[in] | asset | The updated asset. |
MAXON_OBSERVABLE | ( | void | , |
ObservableMetaDataStored | , | ||
(const AssetDescription &asset, const InternedId &metaId, AssetMetaDataInterface::KIND kind, const Data &prevData, const Data &newData) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the storage of a meta data attribute value, see StoreMetaData. The observers are called not only when this happens for this repository itself, but also when it happens for one of its base repositories.
[in] | asset | The asset. |
[in] | metaId | The identifier of the stored meta data attribute. |
[in] | kind | The meta data kind. |
[in] | prevData | The previous value of the attribute (may be empty). |
[in] | newData | The new value of the attribute. |
MAXON_OBSERVABLE | ( | void | , |
ObservableDownloadStateChanged | , | ||
(const AssetRepositoryRef &repository, Bool finished) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Informs about the download state change in the repository.
[in] | repository | The repository with the changes assets. |
MAXON_METHOD Result<const GenericData&> GetCachedData | ( | MoveDataPtr && | key, |
const Delegate< Result< GenericData >()> & | callback | ||
) |
MAXON_METHOD Result<Id> GetDescriptionDatabaseId | ( | ) | const |
MAXON_METHOD Result<DataDescription> LoadDescription | ( | const Id & | category, |
const LanguageRef & | language, | ||
const AssetDescription & | asset | ||
) |
MAXON_METHOD Result<DataDescription> LoadDescription | ( | const Id & | category, |
const LanguageRef & | language, | ||
const IdAndVersion & | dataType | ||
) |
MAXON_FUNCTION Result<DataDescription> LoadDescription | ( | const Id & | category, |
const LanguageRef & | language, | ||
const Id & | dataType | ||
) |
MAXON_METHOD Result<DataDescriptionDefinition> LoadDescriptionDefinition | ( | LOADDESCRIPTIONMODE | mode, |
const Id & | category, | ||
const LanguageRef & | language, | ||
const AssetDescription & | asset | ||
) |
MAXON_METHOD Result<String> GetRepositoryName | ( | const LanguageRef & | language, |
Bool | addDetails | ||
) | const |
GetRepositoryName returns the name of the repository in the requested language.
[in] | language | Language to query. |
MAXON_METHOD Result<void> SetRepositoryName | ( | const String & | name, |
const LanguageRef & | language | ||
) |
SetRepositoryName sets the name of the repository in the given language.
[in] | name | Name to set. |
[in] | language | Language. |
MAXON_METHOD Result<const DerivedAssetRepositoryDataRef&> GetCachedData | ( | MoveDataPtr && | key, |
const Delegate< Result< DerivedAssetRepositoryDataRef >()> & | callback | ||
) |
|
protected |
Informs all observers of ObservableBaseChanged and calls HandleBaseChanged on all derived repositories.
[in] | base | The base repository. |
[in] | added | True if base has been added, false if it has been removed. |
|
protected |
Informs all observers of ObservableAssetStored and calls HandleAssetStored on all derived repositories.
[in] | asset | The description of the new asset version. |
|
protected |
Informs all observers of ObservableAssetErased and calls HandleAssetErased on all derived repositories.
[in] | asset | The description of the erased asset version. |
|
protected |
Informs all observers of ObservableAssetUpdated and calls HandleAssetUpdated on all derived repositories.
[in] | asset | The updated asset. |
|
protected |
Informs all observers of ObservableMetaDataStored and calls HandleMetaDataStored on all derived repositories.
[in] | asset | The asset. |
[in] | metaId | The identifier of the stored meta data attribute. |
[in] | kind | The meta data kind. |
[in] | prevData | The previous value of the attribute (may be empty). |
[in] | newData | The new value of the attribute. |
MAXON_METHOD void HandleDownloadStateChanged | ( | const AssetRepositoryRef & | repository, |
Bool | finished | ||
) |
Informs all observers of ObservableDownloadStateChanged and calls HandleDownloadStateChanged on all derived repositories.
[in] | repository | The repository. |
[in] | finished | True if finished |
MAXON_METHOD void RequestUnloadRepository | ( | ) |
RequestUnloadRepository is called if the user requested to reload or remove the repository. This function should stop all running background threads/jobs to free references to this repo.
Result<AssetDescription> StoreAsset | ( | const Id & | aid, |
ASSET & | asset, | ||
const AssetMetaData & | metaData | ||
) |