comparison OrthancServer/Search/LookupResource.h @ 1751:fb569ee09a69 db-changes

LookupResource complete
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Oct 2015 16:05:42 +0100
parents 55d52567bebb
children faf2ecab3472
comparison
equal deleted inserted replaced
1750:55d52567bebb 1751:fb569ee09a69
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>
39 40
40 namespace Orthanc 41 namespace Orthanc
41 { 42 {
42 class LookupResource : public boost::noncopyable 43 class LookupResource : public boost::noncopyable
43 { 44 {
76 77
77 void ApplyLevel(SetOfResources& candidates, 78 void ApplyLevel(SetOfResources& candidates,
78 ResourceType level, 79 ResourceType level,
79 IDatabaseWrapper& database) const; 80 IDatabaseWrapper& database) const;
80 81
81 void ApplyUnoptimizedConstraints(SetOfResources& candidates, 82 bool ApplyUnoptimizedConstraints(std::list<int64_t>& result,
83 const std::list<int64_t>& candidates,
84 boost::mutex& databaseMutex,
82 IDatabaseWrapper& database, 85 IDatabaseWrapper& database,
83 IStorageArea& storageArea) const; 86 IStorageArea& storageArea) const;
84 87
85 public: 88 public:
86 LookupResource(ResourceType level); 89 LookupResource(ResourceType level);
87 90
88 ~LookupResource(); 91 ~LookupResource();
89 92
90 void Add(IFindConstraint* constraint); // Takes ownership 93 void Add(IFindConstraint* constraint); // Takes ownership
94
95 void Add(const DicomTag& tag,
96 const std::string& dicomQuery,
97 bool caseSensitivePN);
91 98
92 void SetMaxResults(size_t maxResults) 99 void SetMaxResults(size_t maxResults)
93 { 100 {
94 maxResults_ = maxResults; 101 maxResults_ = maxResults;
95 } 102 }
97 size_t GetMaxResults() const 104 size_t GetMaxResults() const
98 { 105 {
99 return maxResults_; 106 return maxResults_;
100 } 107 }
101 108
102 void Apply(std::list<int64_t>& result, 109 bool Apply(std::list<int64_t>& result,
110 boost::mutex& databaseMutex,
103 IDatabaseWrapper& database, 111 IDatabaseWrapper& database,
104 IStorageArea& storageArea) const; 112 IStorageArea& storageArea) const;
105 113
106 void Apply(std::list<std::string>& result, 114 bool Apply(std::list<std::string>& result,
115 boost::mutex& databaseMutex,
107 IDatabaseWrapper& database, 116 IDatabaseWrapper& database,
108 IStorageArea& storageArea) const; 117 IStorageArea& storageArea) const;
109 }; 118 };
110 } 119 }