2 #ifndef _YI_ASSET_LOADER_H_ 3 #define _YI_ASSET_LOADER_H_ 10 class CYIDecoderThread;
65 virtual void OnDecodeComplete(int32_t nJobID, std::shared_ptr<CYIAsset> pAsset, int32_t nLoadStatus,
void *pListenerPrivate) = 0;
82 void AddDecoder(std::unique_ptr<CYIAssetDecoder> pDecoder);
129 bool LoadFromPath(
const std::shared_ptr<CYIAsset> &pAsset);
206 const uint8_t *pData,
210 void *pListenerPrivate);
212 void OnJobComplete(int32_t nJobID);
217 std::vector<std::unique_ptr<CYIAssetDecoder>> m_decoders;
218 std::map<int32_t, CYIDecoderThread *> m_decodingJobs;
222 int32_t m_nNextDecodingJobID;
224 std::unique_ptr<CYILoadThreadManager> m_pLoadManager;
231 #endif // _YI_ASSET_LOADER_H_
#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
Listener interface for asynchronously decoded asset objects.
Definition: YiAssetLoader.h:50
Definition: YiMutex.h:110
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
A class that loads data in a pool of threads.
Definition: YiLoadThreadManager.h:37
virtual ~CYIAssetLoader()
The base class for an object accessible from script source code.
Definition: YiScriptableObject.h:28
virtual void OnDecodeComplete(int32_t nJobID, std::shared_ptr< CYIAsset > pAsset, int32_t nLoadStatus, void *pListenerPrivate)=0
friend class CYIDecoderThread
Definition: YiAssetLoader.h:41
virtual ~DecodeListener()
Definition: YiAssetLoader.h:53
int32_t LoadAsyncFromPath(const CYIRuntimeTypeInfo &assetType, const CYIString &path, CYIAssetLoadParams *pLoadParams, DecodeListener *pListener, void *pListenerPrivate)
Base class for decoders which can accept specialized parameter objects.
Definition: YiAssetLoadParams.h:16
std::shared_ptr< CYIAsset > LoadFromPath(const CYIRuntimeTypeInfo &assetType, const CYIString &path, CYIAssetLoadParams *pLoadParams=nullptr)
std::unique_ptr< CYIAssetDecoder > RemoveDecoder(const CYIAssetDecoder *pDecoder)
static void SetAssetLocator(const CYIAssetLocator &rLocator)
uint32_t GetDecoderCount()
CYIString ProbeExtension(const CYIRuntimeTypeInfo &assetType, const uint8_t *pData, uint32_t nDataSize) const
uint32_t GetAsyncJobsCount()
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
void AbortAsyncLoad(int32_t nDecodeTaskID)
Definition: YiSignalHandler.h:174
void AddDecoder(std::unique_ptr< CYIAssetDecoder > pDecoder)
static const CYIAssetLocator & GetAssetLocator()
Base class for any asset. An asset provides functions for dynamically loading and unloading itself an...
Definition: YiAsset.h:33
std::shared_ptr< CYIAsset > Load(const CYIRuntimeTypeInfo &assetType, const CYIString &filename, CYIAssetLoadParams *pLoadParams=nullptr)
Base class for all specialized decoders.
Definition: YiAssetDecoder.h:22
int32_t LoadAsync(const CYIRuntimeTypeInfo &assetType, const CYIString &filename, CYIAssetLoadParams *pLoadParams, DecodeListener *pListener, void *pListenerPrivate)
Using a base file path, determines the path to an asset given a file name and an asset type...
Definition: YiAssetLocator.h:118
The asset loader provides an interface for loading asset objects, which in turn wrap resource objects...
Definition: YiAssetLoader.h:39