Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/ParsedDicomCache.h @ 1151:48befc2bf66d broker
ParseDicomFromWadoCommand
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 15 Nov 2019 17:34:19 +0100 |
parents | 2da8b4d6f8c1 |
children | 0ca50d275b9a |
comparison
equal
deleted
inserted
replaced
1150:7aad0984d38a | 1151:48befc2bf66d |
---|---|
28 { | 28 { |
29 class ParsedDicomCache : public boost::noncopyable | 29 class ParsedDicomCache : public boost::noncopyable |
30 { | 30 { |
31 private: | 31 private: |
32 class Item; | 32 class Item; |
33 | |
34 static std::string GetIndex(unsigned int bucket, | |
35 const std::string& bucketKey); | |
33 | 36 |
34 Orthanc::MemoryObjectCache cache_; | 37 Orthanc::MemoryObjectCache cache_; |
35 | 38 |
36 public: | 39 public: |
37 ParsedDicomCache(size_t size) | 40 ParsedDicomCache(size_t size) |
38 { | 41 { |
39 cache_.SetMaximumSize(size); | 42 cache_.SetMaximumSize(size); |
40 } | 43 } |
41 | 44 |
42 void Invalidate(const std::string& key) | 45 void Invalidate(unsigned int bucket, |
46 const std::string& bucketKey) | |
43 { | 47 { |
44 cache_.Invalidate(key); | 48 cache_.Invalidate(GetIndex(bucket, bucketKey)); |
45 } | 49 } |
46 | 50 |
47 void Acquire(const std::string& key, | 51 void Acquire(unsigned int bucket, |
52 const std::string& bucketKey, | |
48 Orthanc::ParsedDicomFile* dicom, | 53 Orthanc::ParsedDicomFile* dicom, |
49 size_t fileSize, | 54 size_t fileSize, |
50 bool hasPixelData); | 55 bool hasPixelData); |
51 | 56 |
52 class Reader : public boost::noncopyable | 57 class Reader : public boost::noncopyable |
55 Orthanc::MemoryObjectCache::Accessor accessor_; | 60 Orthanc::MemoryObjectCache::Accessor accessor_; |
56 Item* item_; | 61 Item* item_; |
57 | 62 |
58 public: | 63 public: |
59 Reader(ParsedDicomCache& cache, | 64 Reader(ParsedDicomCache& cache, |
60 const std::string& key); | 65 unsigned int bucket, |
66 const std::string& bucketKey); | |
61 | 67 |
62 bool IsValid() const | 68 bool IsValid() const |
63 { | 69 { |
64 return item_ != NULL; | 70 return item_ != NULL; |
65 } | 71 } |