Public Slots | Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
tile_map::ImageCache Class Reference

#include <image_cache.h>

Inheritance diagram for tile_map::ImageCache:
Inheritance graph
[legend]

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, ImagePtrcache_
 
QString cache_dir_
 
QMutex cache_mutex_
 
CacheThreadcache_thread_
 
bool exit_
 
QSet< size_t > failed_
 
QNetworkAccessManager network_manager_
 
QSemaphore network_request_semaphore_
 
uint64_t tick_
 
QMap< size_t, ImagePtrunprocessed_
 
QMutex unprocessed_mutex_
 
QMap< QString, size_t > uri_to_hash_map_
 

Static Private Attributes

static const int MAXIMUM_NETWORK_REQUESTS = 6
 

Friends

class CacheThread
 

Detailed Description

Definition at line 100 of file image_cache.h.

Constructor & Destructor Documentation

tile_map::ImageCache::ImageCache ( const QString &  cache_dir,
size_t  size = 4096 
)
explicit

Definition at line 84 of file image_cache.cpp.

tile_map::ImageCache::~ImageCache ( )

Definition at line 104 of file image_cache.cpp.

Member Function Documentation

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 249 of file image_cache.cpp.

void tile_map::ImageCache::ProcessReply ( QNetworkReply *  reply)
slot

Definition at line 209 of file image_cache.cpp.

void tile_map::ImageCache::ProcessRequest ( QString  uri)
slot

Definition at line 192 of file image_cache.cpp.

Friends And Related Function Documentation

friend class CacheThread
friend

Definition at line 136 of file image_cache.h.

Member Data Documentation

QCache<size_t, ImagePtr> tile_map::ImageCache::cache_
private

Definition at line 121 of file image_cache.h.

QString tile_map::ImageCache::cache_dir_
private

Definition at line 119 of file image_cache.h.

QMutex tile_map::ImageCache::cache_mutex_
private

Definition at line 126 of file image_cache.h.

CacheThread* tile_map::ImageCache::cache_thread_
private

Definition at line 132 of file image_cache.h.

bool tile_map::ImageCache::exit_
private

Definition at line 128 of file image_cache.h.

QSet<size_t> tile_map::ImageCache::failed_
private

Definition at line 123 of file image_cache.h.

const int tile_map::ImageCache::MAXIMUM_NETWORK_REQUESTS = 6
staticprivate

Definition at line 138 of file image_cache.h.

QNetworkAccessManager tile_map::ImageCache::network_manager_
private

Definition at line 117 of file image_cache.h.

QSemaphore tile_map::ImageCache::network_request_semaphore_
private

Definition at line 134 of file image_cache.h.

uint64_t tile_map::ImageCache::tick_
private

Definition at line 130 of file image_cache.h.

QMap<size_t, ImagePtr> tile_map::ImageCache::unprocessed_
private

Definition at line 122 of file image_cache.h.

QMutex tile_map::ImageCache::unprocessed_mutex_
private

Definition at line 127 of file image_cache.h.

QMap<QString, size_t> tile_map::ImageCache::uri_to_hash_map_
private

Definition at line 124 of file image_cache.h.


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


tile_map
Author(s): Marc Alban
autogenerated on Thu Jun 6 2019 19:25:35