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 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

◆ ImageCache()

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

Definition at line 84 of file image_cache.cpp.

◆ ~ImageCache()

tile_map::ImageCache::~ImageCache ( )

Definition at line 104 of file image_cache.cpp.

Member Function Documentation

◆ Clear

void tile_map::ImageCache::Clear ( )
slot

Definition at line 115 of file image_cache.cpp.

◆ GetImage()

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.

◆ ProcessReply

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

Definition at line 207 of file image_cache.cpp.

◆ ProcessRequest

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

Definition at line 192 of file image_cache.cpp.

Friends And Related Function Documentation

◆ CacheThread

friend class CacheThread
friend

Definition at line 135 of file image_cache.h.

Member Data Documentation

◆ cache_

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

Definition at line 120 of file image_cache.h.

◆ cache_dir_

QString tile_map::ImageCache::cache_dir_
private

Definition at line 118 of file image_cache.h.

◆ cache_mutex_

QMutex tile_map::ImageCache::cache_mutex_
private

Definition at line 125 of file image_cache.h.

◆ cache_thread_

CacheThread* tile_map::ImageCache::cache_thread_
private

Definition at line 131 of file image_cache.h.

◆ exit_

bool tile_map::ImageCache::exit_
private

Definition at line 127 of file image_cache.h.

◆ failed_

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

Definition at line 122 of file image_cache.h.

◆ MAXIMUM_NETWORK_REQUESTS

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

Definition at line 137 of file image_cache.h.

◆ network_manager_

QNetworkAccessManager tile_map::ImageCache::network_manager_
private

Definition at line 116 of file image_cache.h.

◆ network_request_semaphore_

QSemaphore tile_map::ImageCache::network_request_semaphore_
private

Definition at line 133 of file image_cache.h.

◆ tick_

uint64_t tile_map::ImageCache::tick_
private

Definition at line 129 of file image_cache.h.

◆ unprocessed_

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

Definition at line 121 of file image_cache.h.

◆ unprocessed_mutex_

QMutex tile_map::ImageCache::unprocessed_mutex_
private

Definition at line 126 of file image_cache.h.

◆ uri_to_hash_map_

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

Definition at line 123 of file image_cache.h.


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


tile_map
Author(s): Marc Alban
autogenerated on Sun Sep 8 2024 02:27:24