OpenASIP
2.0
|
#include <CostDatabaseRegistry.hh>
Public Member Functions | |
virtual | ~CostDatabaseRegistry () |
CostDatabase & | costDatabase (const HDB::HDBManager &hdb) |
void | addCostDatabase (CostDatabase *costDatabase, const HDB::HDBManager &hdb) |
bool | hasCostDatabase (const HDB::HDBManager &hdb) |
int | costDatabaseCount () |
CostDatabase & | costDatabase (unsigned int index) |
std::string | hdbPath (unsigned int index) |
Static Public Member Functions | |
static CostDatabaseRegistry & | instance () |
Private Member Functions | |
CostDatabaseRegistry () | |
CostDatabase registry must be created with instance() method. More... | |
Private Attributes | |
std::map< const HDB::HDBManager *, CostDatabase * > | registry_ |
All created CostDatabasess are stored in this map. More... | |
Static Private Attributes | |
static CostDatabaseRegistry * | instance_ = NULL |
Unique instance of the class. More... | |
Registry for multiple CostDatabases.
Definition at line 46 of file CostDatabaseRegistry.hh.
|
virtual |
Destructor.
Definition at line 49 of file CostDatabaseRegistry.cc.
References AssocTools::deleteAllValues(), instance_, and registry_.
|
private |
CostDatabase registry must be created with instance() method.
Constructor.
Definition at line 43 of file CostDatabaseRegistry.cc.
Referenced by instance().
void CostDatabaseRegistry::addCostDatabase | ( | CostDatabase * | costDatabase, |
const HDB::HDBManager & | hdb | ||
) |
Adds CostDatabase and HDB used in the CostDatabase in to the registry.
costDatabase | The cost database to be added in to the registry. |
hdb | The HDB that is used to create the CostDatabase. |
Definition at line 95 of file CostDatabaseRegistry.cc.
References AssocTools::containsKey(), costDatabase(), and registry_.
Referenced by CostDatabase::instance().
CostDatabase & CostDatabaseRegistry::costDatabase | ( | const HDB::HDBManager & | hdb | ) |
Returns CostDatabase that is build against the HDB at given path.
In case the CostDatabase is not found in registry, tries to generate it.
hdbFileName | File name of the HDB to build the CostDatabase against. |
Exception | In case there was a problem while creating the CostDatabase. |
Definition at line 79 of file CostDatabaseRegistry.cc.
References AssocTools::containsKey(), CostDatabase::instance(), and registry_.
Referenced by addCostDatabase(), InterpolatingFUEstimator::initializeEstimator(), InterpolatingRFEstimator::initializeEstimator(), and CostDatabase::instance().
CostDatabase & CostDatabaseRegistry::costDatabase | ( | unsigned int | index | ) |
Returns the CostDatabase from given index.
OutOfRange | Is thrown if index is bigger than the CostDatabase count. |
Definition at line 143 of file CostDatabaseRegistry.cc.
References registry_.
int CostDatabaseRegistry::costDatabaseCount | ( | ) |
Returns the total number of stored CostDatabases.
Definition at line 130 of file CostDatabaseRegistry.cc.
References registry_.
bool CostDatabaseRegistry::hasCostDatabase | ( | const HDB::HDBManager & | hdb | ) |
Returns true if the registry contains a CostDatabase build against the given HDB.
hdb | The HDB that is used in creating the CostDatabase. |
Definition at line 115 of file CostDatabaseRegistry.cc.
References AssocTools::containsKey(), and registry_.
Referenced by CostDatabase::instance().
std::string CostDatabaseRegistry::hdbPath | ( | unsigned int | index | ) |
Returns the full path of the HDB with given index.
OutOfRange | Is thrown if index is out of range. |
Definition at line 167 of file CostDatabaseRegistry.cc.
|
static |
Creates and returns an instance of cost database registry.
Definition at line 60 of file CostDatabaseRegistry.cc.
References CostDatabaseRegistry(), and instance_.
Referenced by CostDatabase::instance(), InterpolatingFUEstimator::InterpolatingFUEstimator(), and InterpolatingRFEstimator::InterpolatingRFEstimator().
|
staticprivate |
Unique instance of the class.
Definition at line 65 of file CostDatabaseRegistry.hh.
Referenced by instance(), and ~CostDatabaseRegistry().
|
private |
All created CostDatabasess are stored in this map.
Definition at line 63 of file CostDatabaseRegistry.hh.
Referenced by addCostDatabase(), costDatabase(), costDatabaseCount(), hasCostDatabase(), hdbPath(), and ~CostDatabaseRegistry().