Base class for resources.
More...
#include <ResourceCache.h>
|
|
void | loading () |
| | Fired when the resource begins downloading.
|
| |
| void | loaded (const QByteArray request) |
| |
|
void | finished (bool success) |
| | Fired when the resource has finished loading.
|
| |
|
void | failed (QNetworkReply::NetworkError error) |
| | Fired when the resource failed to load.
|
| |
|
void | onRefresh () |
| | Fired when the resource is refreshed.
|
| |
|
void | onProgress (uint64_t bytesReceived, uint64_t bytesTotal) |
| | Fired on progress updates.
|
| |
|
void | updateSize (qint64 deltaSize) |
| | Fired when the size changes (through setSize).
|
| |
|
|
int | getLRUKey () const |
| | Returns the key last used to identify this resource in the unused map.
|
| |
|
void | ensureLoading () |
| | Makes sure that the resource has started loading.
|
| |
|
virtual void | setLoadPriorityOperator (const QPointer< QObject > &owner, std::function< float()> priorityOperator) |
| | Sets the load priority for one owner.
|
| |
|
float | getLoadPriority () |
| | Returns the highest load priority across all owners.
|
| |
|
virtual bool | isLoaded () const |
| | Checks whether the resource has loaded.
|
| |
|
virtual bool | isFailed () const |
| | Checks whether the resource has failed to download.
|
| |
|
qint64 | getBytesReceived () const |
| | For loading resources, returns the number of bytes received.
|
| |
|
qint64 | getBytesTotal () const |
| | For loading resources, returns the number of total bytes (<= zero if unknown).
|
| |
|
qint64 | getBytes () const |
| | For loaded resources, returns the number of actual bytes (defaults to total bytes if not explicitly set).
|
| |
|
float | getProgress () const |
| | For loading resources, returns the load progress.
|
| |
|
virtual void | refresh () |
| | Refreshes the resource.
|
| |
|
| virtual void | makeRequest () |
| |
|
virtual bool | isCacheable () const |
| | Checks whether the resource is cacheable.
|
| |
| virtual void | downloadFinished (const QByteArray &data) |
| |
|
void | setSize (const qint64 &bytes) |
| | Called when the download is finished and processed, sets the number of actual bytes.
|
| |
| Q_INVOKABLE void | finishedLoading (bool success) |
| |
|
virtual bool | handleFailedRequest (ResourceRequest::Result result) |
| | Return true if the resource will be retried.
|
| |
|
|
class | ResourceCache |
| |
|
class | ScriptableResource |
| |
Base class for resources.
◆ downloadFinished()
| virtual void Resource::downloadFinished |
( |
const QByteArray & |
data | ) |
|
|
inlineprotectedvirtual |
Called when the download has finished. This should be overridden by subclasses that need to process the data once it is downloaded.
Reimplemented in GeometryResource, and NetworkTexture.
◆ finishedLoading()
| void Resource::finishedLoading |
( |
bool |
success | ) |
|
|
protected |
Called when the download is finished and processed. This should be called by subclasses that override downloadFinished to mark the end of processing.
◆ loaded
| void Resource::loaded |
( |
const QByteArray |
request | ) |
|
|
signal |
Fired when the resource has been downloaded. This can be used instead of downloadFinished to access data before it is processed.
◆ makeRequest()
| void Resource::makeRequest |
( |
| ) |
|
|
protectedvirtual |
Called by ResourceCache to begin loading this Resource. This method can be overriden to provide custom request functionality. If this is done, downloadFinished and ResourceCache::requestCompleted must be called.
Reimplemented in NetworkTexture.
The documentation for this class was generated from the following files: