comparison OrthancServer/Search/DatabaseLookup.h @ 3025:039a9d262d64 db-changes

preparing to speed up find in databases
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Dec 2018 17:05:28 +0100
parents ce310baccda6
children fd587cf51a89
comparison
equal deleted inserted replaced
3024:ef17a587e10d 3025:039a9d262d64
38 namespace Orthanc 38 namespace Orthanc
39 { 39 {
40 class DatabaseLookup : public boost::noncopyable 40 class DatabaseLookup : public boost::noncopyable
41 { 41 {
42 private: 42 private:
43 class TagInfo
44 {
45 private:
46 DicomTagType type_;
47 ResourceType level_;
48
49 public:
50 TagInfo() :
51 type_(DicomTagType_Generic),
52 level_(ResourceType_Instance)
53 {
54 }
55
56 TagInfo(DicomTagType type,
57 ResourceType level) :
58 type_(type),
59 level_(level)
60 {
61 }
62
63 DicomTagType GetType() const
64 {
65 return type_;
66 }
67
68 ResourceType GetLevel() const
69 {
70 return level_;
71 }
72 };
73
74 std::vector<DicomTagConstraint*> constraints_; 43 std::vector<DicomTagConstraint*> constraints_;
75 std::map<DicomTag, TagInfo> tags_;
76
77 void LoadTags(ResourceType level);
78 44
79 public: 45 public:
80 DatabaseLookup(); 46 DatabaseLookup()
47 {
48 }
81 49
82 ~DatabaseLookup(); 50 ~DatabaseLookup();
83 51
84 void Reserve(size_t n) 52 void Reserve(size_t n)
85 { 53 {
97 65
98 bool IsMatch(const DicomMap& value); 66 bool IsMatch(const DicomMap& value);
99 67
100 void AddDicomConstraint(const DicomTag& tag, 68 void AddDicomConstraint(const DicomTag& tag,
101 const std::string& dicomQuery, 69 const std::string& dicomQuery,
102 bool caseSensitivePN); 70 bool caseSensitivePN,
71 bool mandatoryTag);
103 }; 72 };
104 } 73 }