2 #ifndef _YI_REMOTE_ASSET_CATALOG_H_ 3 #define _YI_REMOTE_ASSET_CATALOG_H_ 42 static std::shared_ptr<CYIRemoteAssetCatalog>
Create(
const CYIString &name);
201 void OnManifestDownloadCompleted(
const std::shared_ptr<CYIHTTPRequest> &pRequest,
const std::shared_ptr<CYIHTTPResponse> &pResponse,
bool bCachedResponse);
246 struct AssetDownloadInfo
248 AssetDownloadInfo(
const std::shared_ptr<CYIRemoteAssetDownloadHelper> &pDownloadHelper,
const CYIRuntimeTypeInfo &assetType);
250 std::shared_ptr<CYIRemoteAssetDownloadHelper> m_pDownloadHelper;
259 void FetchAssetsFromManifest();
266 uint64_t m_uCatalogID;
269 std::shared_ptr<CYIHTTPRequest> m_pManifestDownloadRequest;
270 std::map<CYIString, AssetDownloadInfo> m_assetsData;
271 bool m_bManifestDowloaded;
281 #endif // _YI_REMOTE_ASSET_CATALOG_H_ void RemoveAssetFromDownloadList(const CYIString &assetName)
An asset representing remote asset catalogs.
Definition: YiRemoteAssetCatalog.h:30
const std::vector< uint8_t > & GetData(const CYIString &assetName) const
CYIString GetRelativeCatalogUrlForAsset(const CYIString &assetName) const
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:114
Occurs if the manifest is empty while attempting to fetch assets.
Definition: YiRemoteAssetCatalog.h:52
std::shared_ptr< CYIAsset > GetAsset(const CYIString &assetName) const
virtual ~CYIRemoteAssetCatalog()
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
CYISignal< const CYIUrl &, const FAILURE_TYPE, const CYIUrl & > AssetDownloadFailed
Definition: YiRemoteAssetCatalog.h:168
std::vector< CYIString > GetAssetList() const
void OnAssetDownloadFailed(CYIRemoteAssetDownloadHelper::FAILURE_TYPE eFailureType, const CYIUrl &url)
CYISignal< const CYIUrl & > AssetDownloadCompleted
Definition: YiRemoteAssetCatalog.h:163
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
void OnManifestDownloadFailed(const std::shared_ptr< CYIHTTPRequest > &pRequest, const HTTP_STATUS_CODE statusCode, const CYIString &errorMessage)
void DownloadManifest(const CYIUrl &url)
const CYIUrl & GetUrl() const
Stores information for the asset manifest.
Definition: YiAssetManifest.h:21
std::shared_ptr< CYIAsset > DecodeAsset(const CYIString &path, CYIAssetLoadParams *pLoadParams=nullptr) const
FAILURE_TYPE
Definition: YiAbstractDownloadHelper.h:38
CYIRemoteAssetCatalog(const CYIString &name)
void OnAssetDownloadCompleted(const CYIUrl &url)
Base class for decoders which can accept specialized parameter objects.
Definition: YiAssetLoadParams.h:16
virtual std::pair< uint32_t, uint32_t > GetApproximateSize() const override
CYIString GetAbsoluteCatalogUrlForAsset(const CYIString &assetName) const
bool IsManifestDownloaded() const
static std::shared_ptr< CYIRemoteAssetCatalog > Create(const CYIString &name)
Occurs if the manifest URL provided is invalid.
Definition: YiRemoteAssetCatalog.h:49
bool AddAssetToDownloadList(const CYIString &assetName, const CYIRuntimeTypeInfo &assetTypeInfo)
Occurs if while downloading, the HTTP request fails for any reason.
Definition: YiRemoteAssetCatalog.h:50
bool QueueTemplateDependenciesForDownload(const CYIString &assetName)
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
A class used to encapsulate an URL.
Definition: YiUrl.h:24
uint64_t GetCatalogID() const
CYIUrl GetAssetDownloadURL(const CYIString &assetName, const CYIRuntimeTypeInfo &typeInfo) const
CYISignal< const CYIUrl & > DownloadCancelled
Definition: YiRemoteAssetCatalog.h:178
Definition: YiSignalHandler.h:174
HTTP_STATUS_CODE
Definition: YiHTTPService.h:20
CYISignal< const CYIUrl & > ManifestDownloadCompleted
Definition: YiRemoteAssetCatalog.h:183
Occurs if while parsing or decoding, the asset is invalid for the specified type. ...
Definition: YiRemoteAssetCatalog.h:51
Base class for any asset. An asset provides functions for dynamically loading and unloading itself an...
Definition: YiAsset.h:33
bool IsAssetInDownloadList(const CYIString &assetName) const
CYISignal< const CYIUrl &, const FAILURE_TYPE > ManifestDownloadFailed
Definition: YiRemoteAssetCatalog.h:173
void DownloadManifestAndAssets(const CYIUrl &url)
const CYIAssetManifest & GetAssetManifest() const
void OnManifestDownloadCompleted(const std::shared_ptr< CYIHTTPRequest > &pRequest, const std::shared_ptr< CYIHTTPResponse > &pResponse, bool bCachedResponse)
FAILURE_TYPE
Definition: YiRemoteAssetCatalog.h:47
The asset loader provides an interface for loading asset objects, which in turn wrap resource objects...
Definition: YiAssetLoader.h:39