comparison OrthancFramework/Sources/FileStorage/StorageCache.h @ 5427:111e21b4f8bc

fix transcoded instance caching
author Alain Mazy <am@osimis.io>
date Fri, 17 Nov 2023 08:22:17 +0100
parents c65e036d649b
children 4be5f117aa0d
comparison
equal deleted inserted replaced
5426:c65e036d649b 5427:111e21b4f8bc
44 // the cache if multiple users try to access the same item at the same time. 44 // the cache if multiple users try to access the same item at the same time.
45 // This scenario happens a lot when multiple workers from a viewer access 45 // This scenario happens a lot when multiple workers from a viewer access
46 // the same file. 46 // the same file.
47 class Accessor : public MemoryStringCache::Accessor 47 class Accessor : public MemoryStringCache::Accessor
48 { 48 {
49 StorageCache& storageCache_;
49 public: 50 public:
50 Accessor(StorageCache& cache); 51 Accessor(StorageCache& cache);
51 52
52 void Add(const std::string& uuid, 53 void Add(const std::string& uuid,
53 FileContentType contentType, 54 FileContentType contentType,
80 const void* buffer, 81 const void* buffer,
81 size_t size); 82 size_t size);
82 }; 83 };
83 84
84 private: 85 private:
85 MemoryStringCache cache_; 86 MemoryStringCache cache_;
86 87 std::set<DicomTransferSyntax> subKeysTransferSyntax_;
88 boost::mutex subKeysMutex_;
89
87 public: 90 public:
88 void SetMaximumSize(size_t size); 91 void SetMaximumSize(size_t size);
89 92
90 void Invalidate(const std::string& uuid, 93 void Invalidate(const std::string& uuid,
91 FileContentType contentType); 94 FileContentType contentType);