83 for (CacheTable::const_iterator i =
entryCache_.begin();
86 newEntryCache.push_back((*i)->copy());
115 if (components.size() == 0) {
121 if (!cache_entries.empty()) {
122 return cache_entries;
128 for (MatcherTable::const_iterator i = matcher.begin();
129 i != matcher.end(); i++) {
131 (*i)->quickFilter(searchKey, components);
135 for (MatcherTable::const_iterator i = matcher.begin();
136 i != matcher.end(); i++) {
138 (*i)->filter(searchKey, components);
163 if ((*i)->isEqual(match, &searchKey)) {
164 cacheEntries = (*i)->entries();
181 for (CostDBTypes::MatchTypeTable::const_iterator i = match.begin();
182 i != match.end(); i++) {
186 new_matcher =
new ExactMatch((*i)->fieldType());
188 new_matcher =
new SubSet((*i)->fieldType());
190 new_matcher =
new SuperSet((*i)->fieldType());
197 "FilterSearch::createMatchers");
200 assert(new_matcher != NULL);
202 matcher.push_back(new_matcher);
222 searchKey_(key), entries_(entry) {
224 for (CostDBTypes::MatchTypeTable::iterator i = matchingType.begin();
225 i != matchingType.end(); i++) {
238 assert(searchKey_ != NULL);
242 for (CostDBTypes::MatchTypeTable::iterator i = matchType_.begin();
243 i != matchType_.end(); i++) {
265 for (CostDBTypes::MatchTypeTable::const_iterator i = matchType_.begin();
266 i != matchType_.end(); i++) {
267 newMatchType.push_back(
268 new MatchType((*i)->fieldType(), (*i)->matchingType()));
272 for (CostDBTypes::EntryTable::const_iterator i = entries_.begin();
273 i != entries_.end(); i++) {
274 newEntries.push_back(*i);
294 if (!searchKey_->isEqual(*key)) {
300 for (CostDBTypes::MatchTypeTable::const_iterator i = matchingType.begin();
301 i != matchingType.end(); i++) {
303 bool isThere =
false;
304 for (CostDBTypes::MatchTypeTable::const_iterator j =
305 matchType_.begin(); j != matchType_.end(); j++) {
307 if ((*i)->isEqual(*(*j))) {
#define assert(condition)
CostDBEntryKey * copy() const
std::vector< MatchType * > MatchTypeTable
Table of types of match.
std::vector< CostDBEntry * > EntryTable
Table of database entries.
CostDBTypes::MatchTypeTable matchType_
Type of match used for these results.
CostDBTypes::EntryTable entries() const
bool isEqual(CostDBTypes::MatchTypeTable matchingType, const CostDBEntryKey *key) const
Cache(CostDBTypes::MatchTypeTable matchingType, CostDBEntryKey *key, CostDBTypes::EntryTable &entry)
MatcherTable matcherStorage_
Storage for all matchers. They cannot be deleted before search strategy itself is deleted....
CacheTable entryCache_
Results of the previous queries.
CostDBTypes::EntryTable findFromCache(const CostDBEntryKey &searchKey, const CostDBTypes::MatchTypeTable &match)
CostDBTypes::EntryTable search(const CostDBEntryKey &searchKey, CostDBTypes::EntryTable components, const CostDBTypes::MatchTypeTable &match)
std::vector< Matcher * > MatcherTable
Table of matcher types.
SearchStrategy * copy() const
std::vector< Cache * > CacheTable
Table of cache entries.
MatcherTable createMatchers(const CostDBTypes::MatchTypeTable &match)