OpenASIP
2.0
|
#include <CostDBEntry.hh>
Public Member Functions | |
CostDBEntry (CostDBEntryKey *key) | |
CostDBEntry (const CostDBEntry &entry1, const CostDBEntry &entry2, const EntryKeyField &weighter) | |
virtual | ~CostDBEntry () |
CostDBEntry * | copy () const |
EntryKeyField | keyFieldOfType (const EntryKeyFieldProperty &type) const |
EntryKeyField | keyFieldOfType (std::string type) const |
const EntryKeyProperty * | type () const |
void | replaceField (EntryKeyField *newField) |
int | fieldCount () const |
const EntryKeyField & | field (int index) const |
bool | isEqualKey (const CostDBEntry &entry) const |
void | addStatistics (CostDBEntryStats *newStats) |
int | statisticsCount () const |
const CostDBEntryStats & | statistics (int index) const |
Private Types | |
typedef std::vector< CostDBEntryStats * > | StatsTable |
Type definition for a table of statistics. More... | |
Private Member Functions | |
CostDBEntry (const CostDBEntry &) | |
Copying not allowed. More... | |
CostDBEntry & | operator= (const CostDBEntry &) |
Assignment not allowed. More... | |
Private Attributes | |
CostDBEntryKey * | entryKey_ |
Key of the entry. More... | |
StatsTable | entryStats_ |
Statistics of the entry. More... | |
Represents an entry containing a key and statistics.
Key means the properties of an entry that are used as a search key.
Definition at line 52 of file CostDBEntry.hh.
|
private |
Type definition for a table of statistics.
Definition at line 77 of file CostDBEntry.hh.
CostDBEntry::CostDBEntry | ( | CostDBEntryKey * | key | ) |
Constructor.
key | An entry key. |
Definition at line 44 of file CostDBEntry.cc.
Referenced by copy().
CostDBEntry::CostDBEntry | ( | const CostDBEntry & | entry1, |
const CostDBEntry & | entry2, | ||
const EntryKeyField & | weighter | ||
) |
Constructor.
Combines two entries into one using weighter as a weighting factor on interpolating the statistics. Also replacing weighter field in entry key.
entry1 | First entry. |
entry2 | Second entry. |
weighter | A field. |
Definition at line 59 of file CostDBEntry.cc.
References addStatistics(), EntryKeyField::coefficient(), CostDBEntryKey::copy(), entryKey_, entryStats_, keyFieldOfType(), CostDBEntryKey::replaceField(), and EntryKeyField::type().
|
virtual |
Destructor.
Definition at line 99 of file CostDBEntry.cc.
References assert, entryKey_, and entryStats_.
|
private |
Copying not allowed.
void CostDBEntry::addStatistics | ( | CostDBEntryStats * | newStats | ) |
Add new statistics into this entry.
newStats | Statistics to be added. |
Definition at line 213 of file CostDBEntry.cc.
References entryStats_.
Referenced by CostDatabase::buildBuses(), CostDatabase::buildFunctionUnits(), CostDatabase::buildRegisterFiles(), CostDatabase::buildSockets(), copy(), and CostDBEntry().
CostDBEntry * CostDBEntry::copy | ( | ) | const |
Copies the entry.
Client is responsible of deallocating the memory reserved for the returned object.
Definition at line 120 of file CostDBEntry.cc.
References addStatistics(), CostDBEntryKey::copy(), CostDBEntry(), entryKey_, and entryStats_.
const EntryKeyField & CostDBEntry::field | ( | int | index | ) | const |
Returns the field found on the given index.
The index must be between 0 and the number of entry key - 1.
index | Index. |
Definition at line 182 of file CostDBEntry.cc.
References entryKey_, and CostDBEntryKey::field().
Referenced by Matcher::onlyThisFieldDiffers().
int CostDBEntry::fieldCount | ( | ) | const |
Returns the number of fields in an entry.
Definition at line 169 of file CostDBEntry.cc.
References entryKey_, and CostDBEntryKey::fieldCount().
Referenced by Matcher::onlyThisFieldDiffers().
bool CostDBEntry::isEqualKey | ( | const CostDBEntry & | entry | ) | const |
Checks whether two entries have equal key.
entry | Database entry to compare with. |
Definition at line 203 of file CostDBEntry.cc.
References entryKey_, and CostDBEntryKey::isEqual().
EntryKeyField CostDBEntry::keyFieldOfType | ( | const EntryKeyFieldProperty & | type | ) | const |
Returns demanded field of the entry.
type | Type of the field. |
Definition at line 148 of file CostDBEntry.cc.
References entryKey_, CostDBEntryKey::keyFieldOfType(), and type().
Referenced by CostDBEntry(), and Matcher::onlyThisFieldDiffers().
EntryKeyField CostDBEntry::keyFieldOfType | ( | std::string | type | ) | const |
Returns demanded field of the entry.
type | Type of the field. |
Definition at line 159 of file CostDBEntry.cc.
References entryKey_, CostDBEntryKey::keyFieldOfType(), and type().
|
private |
Assignment not allowed.
void CostDBEntry::replaceField | ( | EntryKeyField * | newField | ) |
Replaces certain field of the entry.
newField | A field. |
Definition at line 192 of file CostDBEntry.cc.
References entryKey_, and CostDBEntryKey::replaceField().
const CostDBEntryStats & CostDBEntry::statistics | ( | int | index | ) | const |
Returns the statistics according to given index.
index | The index of the statistics. |
OutOfRange | Index is out of bounds. |
Definition at line 236 of file CostDBEntry.cc.
References entryStats_, and statisticsCount().
Referenced by CostDatabase::insertEntry().
int CostDBEntry::statisticsCount | ( | ) | const |
Returns the number of statistics in the entry.
Definition at line 224 of file CostDBEntry.cc.
References entryStats_.
Referenced by CostDatabase::insertEntry(), and statistics().
const EntryKeyProperty * CostDBEntry::type | ( | ) | const |
Returns type of the entry.
Definition at line 137 of file CostDBEntry.cc.
References entryKey_, and CostDBEntryKey::type().
Referenced by CostDatabase::insertEntry(), and keyFieldOfType().
|
private |
Key of the entry.
Definition at line 80 of file CostDBEntry.hh.
Referenced by copy(), CostDBEntry(), field(), fieldCount(), isEqualKey(), keyFieldOfType(), replaceField(), type(), and ~CostDBEntry().
|
private |
Statistics of the entry.
Definition at line 82 of file CostDBEntry.hh.
Referenced by addStatistics(), copy(), CostDBEntry(), statistics(), statisticsCount(), and ~CostDBEntry().