Open Search
    AssetDataBasesInterface Class Reference

    #include <asset_databases.h>

    Inheritance diagram for AssetDataBasesInterface:

    Detailed Description

    This interface provides helper functions to register asset repositories.

    Public Member Functions

     MAXON_OBSERVABLE_STATIC (Result< void >, ObservableQueryDatabases,(const ValueReceiver< const Url & > &databaseUrl), ObservableCombinerRunAllComponent)
     

    Static Public Member Functions

    static MAXON_METHOD Result< UrlFindRepository (const AssetRepositoryRef &repository)
     
    static MAXON_METHOD ForwardRef< AssetRepositoryRef > FindRepository (const Url &url)
     
    static MAXON_METHOD Result< void > GetDatabases (const ValueReceiver< const AssetDatabaseStruct & > &entry)
     
    static MAXON_METHOD Result< void > SetDatabases (const Block< AssetDatabaseStruct > &newDataBases)
     
    static MAXON_METHOD Result< void > WriteGmlDependencies ()
     
    static MAXON_METHOD Url GetAssetDatabaseCachePath ()
     
    static MAXON_METHOD Result< void > SetAssetDatabaseCachePath (const Url &cachePath)
     
    static MAXON_METHOD Result< Int64GetAssetDatabaseCacheSize ()
     
    static MAXON_METHOD Result< void > ClearAssetDatabaseCache ()
     
    static MAXON_METHOD Bool WaitForDatabaseLoading ()
     
    static MAXON_METHOD Result< void > ReloadAssetRepositories (Bool forceReload)
     

    Private Member Functions

     MAXON_INTERFACE (AssetDataBasesInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.assetdatabases", MAXON_IMPLEMENTATION_MODULE("net.maxon.asset"))
     

    Member Function Documentation

    ◆ MAXON_INTERFACE()

    MAXON_INTERFACE ( AssetDataBasesInterface  ,
    MAXON_REFERENCE_CONST  ,
    "net.maxon.interface.assetdatabases"  ,
    MAXON_IMPLEMENTATION_MODULE("net.maxon.asset")   
    )
    private

    ◆ FindRepository() [1/2]

    static MAXON_METHOD Result<Url> FindRepository ( const AssetRepositoryRef &  repository)
    static

    Returns the url of a asset repository.

    Parameters
    [in]repositoryRepository to find.
    Returns
    Url of the repository on success.

    ◆ FindRepository() [2/2]

    static MAXON_METHOD ForwardRef<AssetRepositoryRef> FindRepository ( const Url url)
    static

    Returns the asset repository for a Url

    Parameters
    [in]urlUrl of the repository to find.
    Returns
    Found repository (if any).

    ◆ GetDatabases()

    static MAXON_METHOD Result<void> GetDatabases ( const ValueReceiver< const AssetDatabaseStruct & > &  entry)
    static

    Returns all repositories added by the user.

    Parameters
    [in]entryValueReceiver to receive the entries.
    Returns
    OK on success.

    ◆ SetDatabases()

    static MAXON_METHOD Result<void> SetDatabases ( const Block< AssetDatabaseStruct > &  newDataBases)
    static

    Set the new user repositories.

    Parameters
    [in]newDataBasesBlock with tuples of the new urls and activation states.
    Returns
    OK on success.

    ◆ WriteGmlDependencies()

    static MAXON_METHOD Result<void> WriteGmlDependencies ( )
    static

    Writes the gml file with the dependencies of the given asset repository.

    Returns
    OK on success.

    ◆ GetAssetDatabaseCachePath()

    static MAXON_METHOD Url GetAssetDatabaseCachePath ( )
    static

    GetAssetDatabaseCachePath returns the path to the cache folder.

    ◆ SetAssetDatabaseCachePath()

    static MAXON_METHOD Result<void> SetAssetDatabaseCachePath ( const Url cachePath)
    static

    SetAssetDatabaseCachePath sets a new cache path to store temporary downloaded objects

    Parameters
    [in]cachePathPath to set.
    Returns
    OK on success.

    ◆ GetAssetDatabaseCacheSize()

    static MAXON_METHOD Result<Int64> GetAssetDatabaseCacheSize ( )
    static

    GetAssetDatabaseCacheSize returns the size of the cached files.

    ◆ ClearAssetDatabaseCache()

    static MAXON_METHOD Result<void> ClearAssetDatabaseCache ( )
    static

    ClearAssetDatabaseCache deletes the cache.

    Returns
    OK on success.

    ◆ WaitForDatabaseLoading()

    static MAXON_METHOD Bool WaitForDatabaseLoading ( )
    static

    WaitForDatabaseLoading waits for the execution of the database loading. Since this is async now during the startup and modification of database lists it gives the developer a chance to wait for that end.

    Returns
    True if loading is finished. False if canceled.

    ◆ ReloadAssetRepositories()

    static MAXON_METHOD Result<void> ReloadAssetRepositories ( Bool  forceReload)
    static

    ReloadDatabases reloads the asset repositories from disk.

    Parameters
    [in]forceReloadTrue if databases should be forces to be reloaded. False to only load new databases and remove unused.
    Returns
    OK on success.

    ◆ MAXON_OBSERVABLE_STATIC()

    MAXON_OBSERVABLE_STATIC ( Result< void >  ,
    ObservableQueryDatabases  ,
    (const ValueReceiver< const Url & > &databaseUrl)  ,
    ObservableCombinerRunAllComponent   
    )

    Observable to receive additional databases to add to the application. the receiver needs to receive a url with the URLFLAGS::ASSETREPOSITORYTYPE set correctly e.g. url.Set(URLFLAGS::ASSETREPOSITORYTYPE, AssetRepositoryTypes::AssetDatabase().GetId()) iferr_return;