OpenASIP  2.0
Public Member Functions | Private Member Functions | List of all members
ExactMatch Class Reference

#include <ExactMatch.hh>

Inheritance diagram for ExactMatch:
Inheritance graph
Collaboration diagram for ExactMatch:
Collaboration graph

Public Member Functions

 ExactMatch (const EntryKeyFieldProperty *type)
 
virtual ~ExactMatch ()
 
void quickFilter (const CostDBEntryKey &searchKey, CostDBTypes::EntryTable &components)
 
void filter (const CostDBEntryKey &, CostDBTypes::EntryTable &)
 
- Public Member Functions inherited from Matcher
 Matcher (const EntryKeyFieldProperty *type)
 
virtual ~Matcher ()
 

Private Member Functions

 ExactMatch (const ExactMatch &)
 Copying not allowed. More...
 
ExactMatchoperator= (const ExactMatch &)
 Assignment not allowed. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Matcher
const EntryKeyFieldPropertyfieldType () const
 
bool onlyThisFieldDiffers (const EntryKeyFieldProperty *type, const CostDBEntry &entry1, const CostDBEntry &entry2) const
 

Detailed Description

Implementation for searching database entries that are equal to the search key in the requested field.

Definition at line 46 of file ExactMatch.hh.

Constructor & Destructor Documentation

◆ ExactMatch() [1/2]

ExactMatch::ExactMatch ( const EntryKeyFieldProperty type)

Constructor.

Parameters
typeType of the field.

Definition at line 46 of file ExactMatch.cc.

46  :
47  Matcher(type) {
48 }

◆ ~ExactMatch()

ExactMatch::~ExactMatch ( )
virtual

Destructor.

Definition at line 53 of file ExactMatch.cc.

53  {
54 }

◆ ExactMatch() [2/2]

ExactMatch::ExactMatch ( const ExactMatch )
private

Copying not allowed.

Member Function Documentation

◆ filter()

void ExactMatch::filter ( const CostDBEntryKey ,
CostDBTypes::EntryTable  
)
virtual

Nothing to do since quick filtering already accepted all possible entries.

Implements Matcher.

Definition at line 86 of file ExactMatch.cc.

88  {
89 }

◆ operator=()

ExactMatch& ExactMatch::operator= ( const ExactMatch )
private

Assignment not allowed.

◆ quickFilter()

void ExactMatch::quickFilter ( const CostDBEntryKey searchKey,
CostDBTypes::EntryTable components 
)
virtual

filters out values unequal to the search key.

Parameters
searchKeySearch key.
componentsEntries from which to find. Updated to contain entries that matched the search request.

Implements Matcher.

Definition at line 64 of file ExactMatch.cc.

66  {
67 
68  CostDBTypes::EntryTable filtered;
69  for (CostDBTypes::EntryTable::iterator i = components.begin();
70  i != components.end(); i++) {
71 
72  if ((*i)->keyFieldOfType(*fieldType()).isEqual(
73  searchKey.keyFieldOfType(*fieldType()))) {
74 
75  filtered.push_back(*i);
76  }
77  }
78  components = filtered;
79 }

References Matcher::fieldType(), and CostDBEntryKey::keyFieldOfType().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
Matcher::Matcher
Matcher(const EntryKeyFieldProperty *type)
Definition: Matcher.cc:44
CostDBTypes::EntryTable
std::vector< CostDBEntry * > EntryTable
Table of database entries.
Definition: CostDBTypes.hh:111
Matcher::fieldType
const EntryKeyFieldProperty * fieldType() const
CostDBEntryKey::keyFieldOfType
EntryKeyField keyFieldOfType(const EntryKeyFieldProperty &fieldType) const
Definition: CostDBEntryKey.cc:123