Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 1753:faf2ecab3472 db-changes
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Oct 2015 20:31:34 +0100 |
parents | fb569ee09a69 |
children | 3a4f7dc00f49 |
comparison
equal
deleted
inserted
replaced
1752:c3d8ec63a179 | 1753:faf2ecab3472 |
---|---|
2113 boost::mutex::scoped_lock lock(mutex_); | 2113 boost::mutex::scoped_lock lock(mutex_); |
2114 return db_.GetDatabaseVersion(); | 2114 return db_.GetDatabaseVersion(); |
2115 } | 2115 } |
2116 | 2116 |
2117 | 2117 |
2118 bool ServerIndex::Apply(std::list<std::string>& result, | 2118 void ServerIndex::FindCandidates(std::vector<std::string>& resources, |
2119 ::Orthanc::LookupResource& lookup, | 2119 std::vector<std::string>& instances, |
2120 IStorageArea& area) | 2120 ::Orthanc::LookupResource& lookup) |
2121 { | 2121 { |
2122 return lookup.Apply(result, mutex_, db_, area); | 2122 boost::mutex::scoped_lock lock(mutex_); |
2123 | |
2124 std::list<int64_t> tmp; | |
2125 lookup.FindCandidates(tmp, db_); | |
2126 | |
2127 resources.resize(tmp.size()); | |
2128 instances.resize(tmp.size()); | |
2129 | |
2130 size_t pos = 0; | |
2131 for (std::list<int64_t>::const_iterator | |
2132 it = tmp.begin(); it != tmp.end(); ++it, pos++) | |
2133 { | |
2134 int64_t instance; | |
2135 if (!Toolbox::FindOneChildInstance(instance, db_, *it, lookup.GetLevel())) | |
2136 { | |
2137 throw OrthancException(ErrorCode_InternalError); | |
2138 } | |
2139 | |
2140 resources[pos] = db_.GetPublicId(*it); | |
2141 instances[pos] = db_.GetPublicId(instance); | |
2142 } | |
2123 } | 2143 } |
2124 } | 2144 } |