30 #ifndef TILE_MAP_IMAGE_CACHE_H_ 31 #define TILE_MAP_IMAGE_CACHE_H_ 36 #include <boost/cstdint.hpp> 37 #include <boost/shared_ptr.hpp> 43 #include <QNetworkReply> 57 Image(
const QString& uri,
size_t uri_hash, uint64_t priority = 0);
73 if (
priority_ < std::numeric_limits<uint64_t>::max())
105 explicit ImageCache(
const QString& cache_dir,
size_t size = 4096);
108 ImagePtr
GetImage(
size_t uri_hash,
const QString& uri, int32_t priority = 0);
111 void ProcessRequest(QString uri);
112 void ProcessReply(QNetworkReply* reply);
113 void NetworkError(QNetworkReply::NetworkError error);
152 void RequestImage(QString);
165 #endif // TILE_MAP_IMAGE_CACHE_H_ QMap< size_t, ImagePtr > unprocessed_
boost::shared_ptr< QImage > GetImage()
static const int MAXIMUM_FAILURES
boost::shared_ptr< QImage > image_
QNetworkAccessManager network_manager_
boost::shared_ptr< ImageCache > ImageCachePtr
uint64_t Priority() const
QSemaphore network_request_semaphore_
QCache< size_t, ImagePtr > cache_
void SetPriority(uint64_t priority)
Image(const QString &uri, size_t uri_hash, uint64_t priority=0)
boost::shared_ptr< Image > ImagePtr
static const int MAXIMUM_NETWORK_REQUESTS
QMutex unprocessed_mutex_
QMap< QString, size_t > uri_to_hash_map_
void run(ClassLoader *loader)
static const int MAXIMUM_SEQUENTIAL_REQUESTS
CacheThread * cache_thread_
void SetLoading(bool loading)