Mercurial > hg > orthanc
comparison OrthancServer/Search/LookupResource.h @ 1753:faf2ecab3472 db-changes
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Oct 2015 20:31:34 +0100 |
parents | fb569ee09a69 |
children | 39c37a994b2f |
comparison
equal
deleted
inserted
replaced
1752:c3d8ec63a179 | 1753:faf2ecab3472 |
---|---|
34 | 34 |
35 #include "IFindConstraint.h" | 35 #include "IFindConstraint.h" |
36 #include "SetOfResources.h" | 36 #include "SetOfResources.h" |
37 | 37 |
38 #include <memory> | 38 #include <memory> |
39 #include <boost/thread/mutex.hpp> | |
40 | 39 |
41 namespace Orthanc | 40 namespace Orthanc |
42 { | 41 { |
43 class LookupResource : public boost::noncopyable | 42 class LookupResource : public boost::noncopyable |
44 { | 43 { |
68 typedef std::map<ResourceType, Level*> Levels; | 67 typedef std::map<ResourceType, Level*> Levels; |
69 | 68 |
70 ResourceType level_; | 69 ResourceType level_; |
71 Levels levels_; | 70 Levels levels_; |
72 Constraints unoptimizedConstraints_; | 71 Constraints unoptimizedConstraints_; |
73 size_t maxResults_; | |
74 | 72 |
75 bool AddInternal(ResourceType level, | 73 bool AddInternal(ResourceType level, |
76 std::auto_ptr<IFindConstraint>& constraint); | 74 std::auto_ptr<IFindConstraint>& constraint); |
77 | 75 |
78 void ApplyLevel(SetOfResources& candidates, | 76 void ApplyLevel(SetOfResources& candidates, |
79 ResourceType level, | 77 ResourceType level, |
80 IDatabaseWrapper& database) const; | 78 IDatabaseWrapper& database) const; |
81 | 79 |
82 bool ApplyUnoptimizedConstraints(std::list<int64_t>& result, | |
83 const std::list<int64_t>& candidates, | |
84 boost::mutex& databaseMutex, | |
85 IDatabaseWrapper& database, | |
86 IStorageArea& storageArea) const; | |
87 | |
88 public: | 80 public: |
89 LookupResource(ResourceType level); | 81 LookupResource(ResourceType level); |
90 | 82 |
91 ~LookupResource(); | 83 ~LookupResource(); |
84 | |
85 ResourceType GetLevel() const | |
86 { | |
87 return level_; | |
88 } | |
92 | 89 |
93 void Add(IFindConstraint* constraint); // Takes ownership | 90 void Add(IFindConstraint* constraint); // Takes ownership |
94 | 91 |
95 void Add(const DicomTag& tag, | 92 void Add(const DicomTag& tag, |
96 const std::string& dicomQuery, | 93 const std::string& dicomQuery, |
97 bool caseSensitivePN); | 94 bool caseSensitivePN); |
98 | 95 |
99 void SetMaxResults(size_t maxResults) | 96 void FindCandidates(std::list<int64_t>& result, |
100 { | 97 IDatabaseWrapper& database) const; |
101 maxResults_ = maxResults; | |
102 } | |
103 | 98 |
104 size_t GetMaxResults() const | 99 bool IsMatch(const Json::Value& dicomAsJson) const; |
105 { | |
106 return maxResults_; | |
107 } | |
108 | |
109 bool Apply(std::list<int64_t>& result, | |
110 boost::mutex& databaseMutex, | |
111 IDatabaseWrapper& database, | |
112 IStorageArea& storageArea) const; | |
113 | |
114 bool Apply(std::list<std::string>& result, | |
115 boost::mutex& databaseMutex, | |
116 IDatabaseWrapper& database, | |
117 IStorageArea& storageArea) const; | |
118 }; | 100 }; |
119 } | 101 } |