comparison OrthancServer/Sources/Database/FindRequest.h @ 5614:4640b7ae9a11 find-refactoring

moving normalization of constraints into FindRequest
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 May 2024 11:59:56 +0200
parents d4b570834d3a
children 1864b16bc7b1
comparison
equal deleted inserted replaced
5613:f1ce8dd361b7 5614:4640b7ae9a11
35 #include <cassert> 35 #include <cassert>
36 #include <boost/shared_ptr.hpp> 36 #include <boost/shared_ptr.hpp>
37 37
38 namespace Orthanc 38 namespace Orthanc
39 { 39 {
40 class MainDicomTagsRegistry;
41
40 class FindRequest : public boost::noncopyable 42 class FindRequest : public boost::noncopyable
41 { 43 {
42 public: 44 public:
43 /** 45 /**
44 46
151 } 153 }
152 }; 154 };
153 155
154 156
155 private: 157 private:
156
157 // filter & ordering fields 158 // filter & ordering fields
158 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level) 159 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level)
159 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy 160 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy
160 std::vector<DicomTagConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important) 161 std::deque<DatabaseConstraint> dicomTagConstraints_; // All tags filters (note: the order is not important)
161 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important) 162 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important)
162 bool hasLimits_; 163 bool hasLimits_;
163 uint64_t limitsSince_; 164 uint64_t limitsSince_;
164 uint64_t limitsCount_; 165 uint64_t limitsCount_;
165 std::set<std::string> labels_; 166 std::set<std::string> labels_;
179 bool retrieveParentIdentifier_; 180 bool retrieveParentIdentifier_;
180 bool retrieveChildrenIdentifiers_; 181 bool retrieveChildrenIdentifiers_;
181 std::set<MetadataType> retrieveChildrenMetadata_; 182 std::set<MetadataType> retrieveChildrenMetadata_;
182 bool retrieveOneInstanceIdentifier_; 183 bool retrieveOneInstanceIdentifier_;
183 184
185 std::unique_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_;
186
184 public: 187 public:
185 explicit FindRequest(ResourceType level); 188 explicit FindRequest(ResourceType level);
186 189
187 ~FindRequest(); 190 ~FindRequest();
188 191
212 size_t GetDicomTagConstraintsCount() const 215 size_t GetDicomTagConstraintsCount() const
213 { 216 {
214 return dicomTagConstraints_.size(); 217 return dicomTagConstraints_.size();
215 } 218 }
216 219
220 const DatabaseConstraint& GetDicomTagConstraint(size_t index) const;
221
217 size_t GetMetadataConstraintsCount() const 222 size_t GetMetadataConstraintsCount() const
218 { 223 {
219 return metadataConstraints_.size(); 224 return metadataConstraints_.size();
220 } 225 }
221
222 const DicomTagConstraint& GetDicomTagConstraint(size_t index) const;
223 226
224 void SetLimits(uint64_t since, 227 void SetLimits(uint64_t since,
225 uint64_t count); 228 uint64_t count);
226 229
227 bool HasLimits() const 230 bool HasLimits() const