OpenASIP
2.0
|
#include <HDBRegistry.hh>
Public Member Functions | |
virtual | ~HDBRegistry () |
CachedHDBManager & | hdb (const std::string fileName) |
void | loadFromSearchPaths () |
void | addHDB (CachedHDBManager *hdbManager) |
bool | hasHDB (const std::string &hdbFile) |
int | hdbCount () |
CachedHDBManager & | hdb (unsigned int index) |
std::string | hdbPath (unsigned int index) |
int | hdbErrorCount () |
std::string | hdbErrorMessage (unsigned int index) |
Static Public Member Functions | |
static HDBRegistry & | instance () |
Private Member Functions | |
HDBRegistry () | |
HDB registry must be created with instance() method. More... | |
void | removeDeadHDBPaths () |
Deletes nonexistent HDB paths from registry. More... | |
Private Attributes | |
std::map< const std::string, CachedHDBManager * > | registry_ |
all opened HDBs are stored in this map More... | |
std::vector< std::string > | errorMessages_ |
errors found during loading HDBs are strored in this vector More... | |
Static Private Attributes | |
static HDBRegistry * | instance_ = NULL |
Unique instance of the class. More... | |
Registry for multiple HDBs.
Definition at line 46 of file HDBRegistry.hh.
|
virtual |
Destructor.
Definition at line 52 of file HDBRegistry.cc.
References AssocTools::deleteAllValues(), and registry_.
|
private |
HDB registry must be created with instance() method.
Constructor.
Definition at line 46 of file HDBRegistry.cc.
Referenced by instance().
void HDB::HDBRegistry::addHDB | ( | CachedHDBManager * | hdbManager | ) |
Adds HDBManager in to the registry.
Takes responsibility of deleting the given HDBManager.
hdb | The HDBManager to be added in to the registry. |
Definition at line 100 of file HDBRegistry.cc.
References FileSystem::absolutePathOf(), AssocTools::containsKey(), HDB::HDBManager::fileName(), and registry_.
Referenced by HDB::CachedHDBManager::instance().
bool HDB::HDBRegistry::hasHDB | ( | const std::string & | hdbFile | ) |
Returns true if the registry contains a HDBManager of the given HDB file.
hdbFile | The HDB file managed by the HDBManager. |
Definition at line 119 of file HDBRegistry.cc.
References FileSystem::absolutePathOf(), AssocTools::containsKey(), and registry_.
Referenced by HDB::CachedHDBManager::instance().
CachedHDBManager & HDB::HDBRegistry::hdb | ( | const std::string | fileName | ) |
Returns the HDB at given path.
In case the HDB is not found in registry, tries to open it.
fileName | File name of the HDB. |
Definition at line 80 of file HDBRegistry.cc.
References FileSystem::absolutePathOf(), AssocTools::containsKey(), HDB::CachedHDBManager::instance(), and registry_.
Referenced by DefaultICDecoderEstimator::delayOfBus(), DefaultICDecoderEstimator::delayOfSocket(), DefaultICDecoderEstimator::estimateICArea(), DefaultICDecoderEstimator::estimateICDelayOfPath(), DefaultICDecoderEstimator::estimateICEnergy(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), CostEstimator::Estimator::fuCostFunctionPluginOfImplementation(), ComponentImplementationSelector::fuImplementations(), CostEstimator::Estimator::functionUnitArea(), CostEstimator::Estimator::functionUnitEnergy(), CostEstimator::Estimator::functionUnitMaximumComputationDelay(), CostEstimator::Estimator::functionUnitPortReadDelay(), CostEstimator::Estimator::functionUnitPortWriteDelay(), ProGeScriptGenerator::getBlockOrder(), HDB::CachedHDBManager::instance(), ComponentImplementationSelector::iuImplementations(), PlatformIntegrator::loadFUExternalPorts(), main(), CostEstimator::Estimator::registerFileArea(), CostEstimator::Estimator::registerFileEnergy(), CostEstimator::Estimator::registerFileMaximumComputationDelay(), CostEstimator::Estimator::registerFilePortReadDelay(), CostEstimator::Estimator::registerFilePortWriteDelay(), CostEstimator::Estimator::rfCostFunctionPluginOfImplementation(), ComponentImplementationSelector::rfImplementations(), ComponentImplementationSelector::selectComponents(), HDBEditorMainFrame::setHDB(), ImplementationSelector::setupSelector(), AddFUFromHDBDialog::TransferDataToWindow(), and AddRFFromHDBDialog::TransferDataToWindow().
CachedHDBManager & HDB::HDBRegistry::hdb | ( | unsigned int | index | ) |
Returns the HDB from given index.
OutOfRange | Is thrown if index is bigger than the HDB count. |
Definition at line 192 of file HDBRegistry.cc.
References registry_.
int HDB::HDBRegistry::hdbCount | ( | ) |
Returns the total number of stored HDBs.
Definition at line 135 of file HDBRegistry.cc.
References registry_.
Referenced by AutoSelectImplementationsDialog::AutoSelectImplementationsDialog(), BlockImplementationDialog::BlockImplementationDialog(), FrequencySweepExplorer::openHDBs(), ComponentImplementationSelector::selectComponents(), ImplementationSelector::setupSelector(), AddFUFromHDBDialog::TransferDataToWindow(), and AddRFFromHDBDialog::TransferDataToWindow().
int HDB::HDBRegistry::hdbErrorCount | ( | ) |
Returns the number of error messages created during HDB loading.
Definition at line 238 of file HDBRegistry.cc.
References errorMessages_.
Referenced by AddFUFromHDBDialog::TransferDataToWindow(), and AddRFFromHDBDialog::TransferDataToWindow().
std::string HDB::HDBRegistry::hdbErrorMessage | ( | unsigned int | index | ) |
Returns the error message from given index.
OutOfRange | Is thrown if index is bigger than the HDB error count. |
Definition at line 251 of file HDBRegistry.cc.
References errorMessages_.
Referenced by AddFUFromHDBDialog::TransferDataToWindow(), and AddRFFromHDBDialog::TransferDataToWindow().
std::string HDB::HDBRegistry::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 217 of file HDBRegistry.cc.
References assert, and registry_.
Referenced by AutoSelectImplementationsDialog::AutoSelectImplementationsDialog(), and BlockImplementationDialog::BlockImplementationDialog().
|
static |
Creates and returns an instance of HDB registry.
Definition at line 62 of file HDBRegistry.cc.
References HDBRegistry(), and instance_.
Referenced by CostEstimator::Estimator::estimateSocketToSocketDelayOfPath(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), CostEstimator::Estimator::fuCostFunctionPluginOfImplementation(), ComponentImplementationSelector::fuImplementations(), CostEstimator::Estimator::functionUnitArea(), CostEstimator::Estimator::functionUnitEnergy(), CostEstimator::Estimator::functionUnitMaximumComputationDelay(), CostEstimator::Estimator::functionUnitPortReadDelay(), CostEstimator::Estimator::functionUnitPortWriteDelay(), ProGeScriptGenerator::getBlockOrder(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), HDB::CachedHDBManager::instance(), ComponentImplementationSelector::iuImplementations(), PlatformIntegrator::loadFUExternalPorts(), main(), CostEstimator::Estimator::registerFileArea(), CostEstimator::Estimator::registerFileEnergy(), CostEstimator::Estimator::registerFileMaximumComputationDelay(), CostEstimator::Estimator::registerFilePortReadDelay(), CostEstimator::Estimator::registerFilePortWriteDelay(), CostEstimator::Estimator::rfCostFunctionPluginOfImplementation(), ComponentImplementationSelector::rfImplementations(), ComponentImplementationSelector::selectComponents(), HDBEditorMainFrame::setHDB(), and HDBTester::~HDBTester().
void HDB::HDBRegistry::loadFromSearchPaths | ( | ) |
Definition at line 146 of file HDBRegistry.cc.
References FileSystem::absolutePathOf(), AssocTools::containsKey(), FileSystem::directoryContents(), Exception::errorMessage(), errorMessages_, FileSystem::fileExists(), FileSystem::fileIsDirectory(), FileSystem::fileIsReadable(), Environment::hdbPaths(), HDB::CachedHDBManager::instance(), registry_, and removeDeadHDBPaths().
Referenced by AutoSelectImplementationsDialog::AutoSelectImplementationsDialog(), BlockImplementationDialog::BlockImplementationDialog(), FrequencySweepExplorer::openHDBs(), ImplementationSelector::setupSelector(), AddRFFromHDBDialog::TransferDataToWindow(), and AddFUFromHDBDialog::TransferDataToWindow().
|
private |
Deletes nonexistent HDB paths from registry.
Removes nonexistent HDB files from registry.
Definition at line 263 of file HDBRegistry.cc.
References FileSystem::fileExists(), and registry_.
Referenced by loadFromSearchPaths().
|
private |
errors found during loading HDBs are strored in this vector
Definition at line 69 of file HDBRegistry.hh.
Referenced by hdbErrorCount(), hdbErrorMessage(), and loadFromSearchPaths().
|
staticprivate |
Unique instance of the class.
Definition at line 71 of file HDBRegistry.hh.
Referenced by instance().
|
private |
all opened HDBs are stored in this map
Definition at line 67 of file HDBRegistry.hh.
Referenced by addHDB(), hasHDB(), hdb(), hdbCount(), hdbPath(), loadFromSearchPaths(), removeDeadHDBPaths(), and ~HDBRegistry().