Public Slots | Public Member Functions | Private Attributes | Static Private Attributes | Friends
tile_map::ImageCache Class Reference

#include <image_cache.h>

List of all members.

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_
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 99 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.

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


Friends And Related Function Documentation

friend class CacheThread [friend]

Definition at line 134 of file image_cache.h.


Member Data Documentation

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

Definition at line 120 of file image_cache.h.

Definition at line 118 of file image_cache.h.

Definition at line 124 of file image_cache.h.

Definition at line 130 of file image_cache.h.

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.

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.

Definition at line 121 of file image_cache.h.

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.


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


tile_map
Author(s): Marc Alban
autogenerated on Thu Aug 24 2017 02:46:24