OpenASIP
2.0
|
#include <FilterSearch.hh>
Classes | |
class | Cache |
Public Member Functions | |
FilterSearch () | |
virtual | ~FilterSearch () |
SearchStrategy * | copy () const |
CostDBTypes::EntryTable | search (const CostDBEntryKey &searchKey, CostDBTypes::EntryTable components, const CostDBTypes::MatchTypeTable &match) |
Public Member Functions inherited from SearchStrategy | |
virtual | ~SearchStrategy () |
Private Types | |
typedef std::vector< Cache * > | CacheTable |
Table of cache entries. More... | |
typedef std::vector< Matcher * > | MatcherTable |
Table of matcher types. More... | |
Private Member Functions | |
CostDBTypes::EntryTable | findFromCache (const CostDBEntryKey &searchKey, const CostDBTypes::MatchTypeTable &match) |
MatcherTable | createMatchers (const CostDBTypes::MatchTypeTable &match) |
FilterSearch (const FilterSearch &) | |
Copying not allowed. More... | |
FilterSearch & | operator= (const FilterSearch &) |
Assignment not allowed. More... | |
Private Attributes | |
CacheTable | entryCache_ |
Results of the previous queries. More... | |
MatcherTable | matcherStorage_ |
Storage for all matchers. They cannot be deleted before search strategy itself is deleted. Thus, this storage exists to deallocate the memory reserved by matchers. More... | |
Implementation of the queries from the cost database.
Using the FilterSearch algorithm requires only a Search() function call.
Search is based on filtering non-matching entries out according to information of one field at a time. Thus, it is very generic accepting field changes to entries without touching to the searrch algorithms.
Cache and quick filtering is used for optimisation. Cache contains all the results from the previous queries. Quick filtering removes unneccessary entries in linear time in the beginning of the search.
Definition at line 63 of file FilterSearch.hh.
|
private |
Table of cache entries.
Definition at line 106 of file FilterSearch.hh.
|
private |
Table of matcher types.
Definition at line 108 of file FilterSearch.hh.
FilterSearch::FilterSearch | ( | ) |
|
virtual |
Destructor.
Definition at line 53 of file FilterSearch.cc.
References assert, entryCache_, and matcherStorage_.
|
private |
Copying not allowed.
|
virtual |
Returns a copy of this search strategy.
Client is responsible of deallocating the memory reserved for the returned object.
Implements SearchStrategy.
Definition at line 80 of file FilterSearch.cc.
References entryCache_, and FilterSearch().
|
private |
Creates sub components of this search strategy.
match | Type of match. |
TypeMismatch | Requested type is unknown. |
Definition at line 179 of file FilterSearch.cc.
References assert, CostDBTypes::MATCH_ALL, CostDBTypes::MATCH_EXACT, CostDBTypes::MATCH_INTERPOLATION, CostDBTypes::MATCH_SUBSET, CostDBTypes::MATCH_SUPERSET, and matcherStorage_.
Referenced by search().
|
private |
Finds entries matching search key and type of match from the cache.
searchKey | Search key. |
match | Type of match. |
Definition at line 155 of file FilterSearch.cc.
References entryCache_.
Referenced by search().
|
private |
Assignment not allowed.
|
virtual |
Searches entries that match with certain search key on a specific type of match.
Search results are valid until the strategy is deleted, after which the use of the results of the queries might lead into unexpected behaviour.
Client must not deallocate the memory reserved for the results.
searchKey | Search key. |
components | Entries from which to find. |
match | Type of match. The fields are searched in the order they exist in this table. |
Implements SearchStrategy.
Definition at line 110 of file FilterSearch.cc.
References CostDBEntryKey::copy(), createMatchers(), entryCache_, and findFromCache().
|
private |
Results of the previous queries.
Definition at line 116 of file FilterSearch.hh.
Referenced by copy(), findFromCache(), search(), and ~FilterSearch().
|
private |
Storage for all matchers. They cannot be deleted before search strategy itself is deleted. Thus, this storage exists to deallocate the memory reserved by matchers.
Definition at line 120 of file FilterSearch.hh.
Referenced by createMatchers(), and ~FilterSearch().