comparison OrthancServer/Search/LookupIdentifierQuery.cpp @ 1750:55d52567bebb db-changes

LookupResource implemented
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Oct 2015 12:45:50 +0100
parents 99f4a05f39fa
children fb569ee09a69
comparison
equal deleted inserted replaced
1749:99f4a05f39fa 1750:55d52567bebb
201 201
202 void LookupIdentifierQuery::Apply(std::list<std::string>& result, 202 void LookupIdentifierQuery::Apply(std::list<std::string>& result,
203 IDatabaseWrapper& database) 203 IDatabaseWrapper& database)
204 { 204 {
205 SetOfResources resources(database, level_); 205 SetOfResources resources(database, level_);
206 206 Apply(resources, database);
207
208 resources.Flatten(result);
209 }
210
211
212 void LookupIdentifierQuery::Apply(SetOfResources& result,
213 IDatabaseWrapper& database)
214 {
207 for (size_t i = 0; i < GetSize(); i++) 215 for (size_t i = 0; i < GetSize(); i++)
208 { 216 {
209 std::list<int64_t> a; 217 std::list<int64_t> a;
210 218
211 for (size_t j = 0; j < constraints_[i]->GetSize(); j++) 219 for (size_t j = 0; j < constraints_[i]->GetSize(); j++)
215 database.LookupIdentifier(b, level_, constraint.GetTag(), constraint.GetType(), constraint.GetValue()); 223 database.LookupIdentifier(b, level_, constraint.GetTag(), constraint.GetType(), constraint.GetValue());
216 224
217 a.splice(a.end(), b); 225 a.splice(a.end(), b);
218 } 226 }
219 227
220 resources.Intersect(a); 228 result.Intersect(a);
221 } 229 }
222 230 }
223 resources.Flatten(result); 231
224 }
225 } 232 }