Mercurial > hg > orthanc-authorization
comparison Plugin/ResourceHierarchyCache.cpp @ 29:bc0431cb6b8f
fix for compatibility with simplified OrthancPluginCppWrapper
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Dec 2018 21:16:54 +0100 |
parents | c44013681a51 |
children | c304ffca5d80 |
comparison
equal
deleted
inserted
replaced
28:ae19947abf68 | 29:bc0431cb6b8f |
---|---|
58 // Not in the cache, reading the resource from the Orthanc store | 58 // Not in the cache, reading the resource from the Orthanc store |
59 std::string dicomUid; | 59 std::string dicomUid; |
60 OrthancResource parent; | 60 OrthancResource parent; |
61 std::list<OrthancResource> children; | 61 std::list<OrthancResource> children; |
62 | 62 |
63 if (!resource.GetHierarchy(dicomUid, parent, children, context_)) | 63 if (!resource.GetHierarchy(dicomUid, parent, children)) |
64 { | 64 { |
65 // The resource is non-existing (*) | 65 // The resource is non-existing (*) |
66 return false; | 66 return false; |
67 } | 67 } |
68 | 68 |
90 return false; | 90 return false; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 ResourceHierarchyCache::ResourceHierarchyCache(OrthancPluginContext* context, | 95 ResourceHierarchyCache::ResourceHierarchyCache(ICacheFactory& factory) : |
96 ICacheFactory& factory) : | |
97 context_(context), | |
98 cache_(factory.Create()), | 96 cache_(factory.Create()), |
99 orthancToDicom_(factory.Create()), | 97 orthancToDicom_(factory.Create()), |
100 dicomToOrthanc_(factory.Create()) | 98 dicomToOrthanc_(factory.Create()) |
101 { | 99 { |
102 if (cache_.get() == NULL) | 100 if (cache_.get() == NULL) |
160 return true; | 158 return true; |
161 } | 159 } |
162 | 160 |
163 OrthancResource resource(level, orthancId); | 161 OrthancResource resource(level, orthancId); |
164 | 162 |
165 if (resource.GetDicomUid(target, context_)) | 163 if (resource.GetDicomUid(target)) |
166 { | 164 { |
167 orthancToDicom_->Store(key, target, 0 /* no expiration */); | 165 orthancToDicom_->Store(key, target, 0 /* no expiration */); |
168 return true; | 166 return true; |
169 } | 167 } |
170 else | 168 else |
185 return true; | 183 return true; |
186 } | 184 } |
187 | 185 |
188 OrthancResource resource(level, dicomUid); | 186 OrthancResource resource(level, dicomUid); |
189 | 187 |
190 if (OrthancResource::LookupOrthancId(target, context_, level, dicomUid)) | 188 if (OrthancResource::LookupOrthancId(target, level, dicomUid)) |
191 { | 189 { |
192 dicomToOrthanc_->Store(key, target, 0 /* no expiration */); | 190 dicomToOrthanc_->Store(key, target, 0 /* no expiration */); |
193 return true; | 191 return true; |
194 } | 192 } |
195 else | 193 else |