Overte C++ Documentation
ResourceCache Class Referenceabstract

Base class for resource caches. More...

#include <ResourceCache.h>

Inheritance diagram for ResourceCache:

Protected Slots

QSharedPointer< ResourcegetResource (const QUrl &url, const QUrl &fallback=QUrl())
 

Protected Member Functions

virtual QSharedPointer< ResourcecreateResource (const QUrl &url)=0
 Creates a new resource.
 

Static Protected Member Functions

static bool attemptRequest (QSharedPointer< Resource > resource)
 

Friends

class Resource
 
class ScriptableResourceCache
 

Detailed Description

Base class for resource caches.

Member Function Documentation

◆ attemptRequest()

bool ResourceCache::attemptRequest ( QSharedPointer< Resource resource)
staticprotected

Attempt to load a resource if requests are below the limit, otherwise queue the resource for loading

Returns
true if the resource began loading, otherwise false if the resource is in the pending queue

◆ getResource

QSharedPointer<Resource> ResourceCache::getResource ( const QUrl &  url,
const QUrl &  fallback = QUrl() 
)
inlineprotectedslot

Loads a resource from the specified URL and returns it. If the caller is on a different thread than the ResourceCache, returns an empty smart pointer and loads its asynchronously.

Parameters
fallbacka fallback URL to load if the desired one is unavailable

The documentation for this class was generated from the following files: