#include <image_cache.h>
Public Slots | |
| void | Clear () |
| void | NetworkError (QNetworkReply::NetworkError error) |
| void | ProcessReply (QNetworkReply *reply) |
| void | ProcessRequest (QString uri) |
Public Member Functions | |
| ImagePtr | GetImage (size_t uri_hash, const QString &uri, int32_t priority=0) |
| ImageCache (const QString &cache_dir, size_t size=4096) | |
| ~ImageCache () | |
Private Attributes | |
| QCache< size_t, ImagePtr > | cache_ |
| QString | cache_dir_ |
| QMutex | cache_mutex_ |
| CacheThread * | cache_thread_ |
| bool | exit_ |
| QNetworkAccessManager | network_manager_ |
| QSemaphore | network_request_semaphore_ |
| uint64_t | tick_ |
| QMap< size_t, ImagePtr > | unprocessed_ |
| QMutex | unprocessed_mutex_ |
| QMap< QString, size_t > | uri_to_hash_map_ |
Static Private Attributes | |
| static const int | MAXIMUM_NETWORK_REQUESTS = 6 |
Friends | |
| class | CacheThread |
Definition at line 99 of file image_cache.h.
| tile_map::ImageCache::ImageCache | ( | const QString & | cache_dir, |
| size_t | size = 4096 |
||
| ) | [explicit] |
Definition at line 84 of file image_cache.cpp.
Definition at line 104 of file image_cache.cpp.
| void tile_map::ImageCache::Clear | ( | ) | [slot] |
Definition at line 115 of file image_cache.cpp.
| ImagePtr tile_map::ImageCache::GetImage | ( | size_t | uri_hash, |
| const QString & | uri, | ||
| int32_t | priority = 0 |
||
| ) |
Definition at line 121 of file image_cache.cpp.
| void tile_map::ImageCache::NetworkError | ( | QNetworkReply::NetworkError | error | ) | [slot] |
Definition at line 245 of file image_cache.cpp.
| void tile_map::ImageCache::ProcessReply | ( | QNetworkReply * | reply | ) | [slot] |
Definition at line 203 of file image_cache.cpp.
| void tile_map::ImageCache::ProcessRequest | ( | QString | uri | ) | [slot] |
Definition at line 185 of file image_cache.cpp.
friend class CacheThread [friend] |
Definition at line 134 of file image_cache.h.
QCache<size_t, ImagePtr> tile_map::ImageCache::cache_ [private] |
Definition at line 120 of file image_cache.h.
QString tile_map::ImageCache::cache_dir_ [private] |
Definition at line 118 of file image_cache.h.
QMutex tile_map::ImageCache::cache_mutex_ [private] |
Definition at line 124 of file image_cache.h.
CacheThread* tile_map::ImageCache::cache_thread_ [private] |
Definition at line 130 of file image_cache.h.
bool tile_map::ImageCache::exit_ [private] |
Definition at line 126 of file image_cache.h.
const int tile_map::ImageCache::MAXIMUM_NETWORK_REQUESTS = 6 [static, private] |
Definition at line 136 of file image_cache.h.
QNetworkAccessManager tile_map::ImageCache::network_manager_ [private] |
Definition at line 116 of file image_cache.h.
QSemaphore tile_map::ImageCache::network_request_semaphore_ [private] |
Definition at line 132 of file image_cache.h.
uint64_t tile_map::ImageCache::tick_ [private] |
Definition at line 128 of file image_cache.h.
QMap<size_t, ImagePtr> tile_map::ImageCache::unprocessed_ [private] |
Definition at line 121 of file image_cache.h.
QMutex tile_map::ImageCache::unprocessed_mutex_ [private] |
Definition at line 125 of file image_cache.h.
QMap<QString, size_t> tile_map::ImageCache::uri_to_hash_map_ [private] |
Definition at line 122 of file image_cache.h.