OpenASIP  2.0
Public Member Functions | List of all members
RelationalDBConnection Class Referenceabstract

#include <RelationalDBConnection.hh>

Inheritance diagram for RelationalDBConnection:
Inheritance graph
Collaboration diagram for RelationalDBConnection:
Collaboration graph

Public Member Functions

virtual ~RelationalDBConnection ()
 
virtual int updateQuery (const std::string &queryString)=0
 
virtual void DDLQuery (const std::string &queryString)=0
 
virtual RelationalDBQueryResultquery (const std::string &queryString, bool init=true)=0
 
virtual void beginTransaction ()=0
 
virtual void rollback ()=0
 
virtual void commit ()=0
 
virtual RowID lastInsertRowID ()=0
 
virtual int version ()=0
 
virtual void updateVersion (int version)=0
 
virtual bool tableExistsInDB (const std::string &tableName)=0
 
virtual int rowCountInTable (const std::string &tableName)=0
 

Detailed Description

Classes that implement this interface can be used as relational database connection handles.

Definition at line 48 of file RelationalDBConnection.hh.

Constructor & Destructor Documentation

◆ ~RelationalDBConnection()

RelationalDBConnection::~RelationalDBConnection ( )
virtual

Destructor.

Definition at line 40 of file RelationalDBConnection.cc.

40  {
41 }

Member Function Documentation

◆ beginTransaction()

void RelationalDBConnection::beginTransaction ( )
pure virtual

◆ commit()

void RelationalDBConnection::commit ( )
pure virtual

◆ DDLQuery()

void RelationalDBConnection::DDLQuery ( const std::string &  queryString)
pure virtual

Performs a SQL Data Definition Language query, that is a query that may change the structure of the database (CREATE TABLE, etc.).

Does not autocommit the changes in case the update is in the middle of transaction.

Parameters
queryStringThe query string.
Exceptions
RelationalDBExceptionIn case a database error occured.

Implemented in SQLiteConnection.

Definition at line 69 of file RelationalDBConnection.cc.

69 {}

Referenced by HDB::HDBManager::addRFImplementation(), HDB::HDBManager::createNew(), DSDBManager::createNew(), HDB::HDBManager::HDBManager(), and ExecutionTrace::initialize().

◆ lastInsertRowID()

virtual RowID RelationalDBConnection::lastInsertRowID ( )
pure virtual

◆ query()

RelationalDBQueryResult * RelationalDBConnection::query ( const std::string &  queryString,
bool  init = true 
)
pure virtual

Performs a data retrieval query (SELECT).

Parameters
queryStringThe query string.
Returns
A handle to the query result set. Caller owns the instance. Deleting the instance should free all resources connected to the query.
Exceptions
RelationalDBExceptionIn case a database error occured.

Implemented in SQLiteConnection.

Definition at line 80 of file RelationalDBConnection.cc.

80  {
81  return NULL;
82 }

Referenced by HDB::HDBManager::addBlockImplementationFiles(), HDB::HDBManager::addDataPortsToImplementation(), HDB::HDBManager::addFUExternalPortsToImplementation(), HDB::HDBManager::addFUImplementation(), HDB::HDBManager::addFUParametersToImplementation(), HDB::HDBManager::addOpcodesToImplementation(), HDB::HDBManager::addOperationPipelinesToFUArchitecture(), HDB::HDBManager::addPortsAndBindingsToFUArchitecture(), HDB::HDBManager::addRFExternalPortsToImplementation(), HDB::HDBManager::addRFParametersToImplementation(), DSDBManager::applicationCostEstimatesByConf(), DSDBManager::applicationCount(), DSDBManager::applicationIDs(), DSDBManager::applicationPath(), DSDBManager::archConfigurationIDs(), DSDBManager::architectureId(), DSDBManager::architectureIDs(), DSDBManager::architectureString(), DSDBManager::areaEstimate(), HDB::HDBManager::blockSourceFile(), HDB::HDBManager::busCostEstimationData(), HDB::HDBManager::busCostEstimationDataIDs(), HDB::HDBManager::busCostEstimationDataList(), HDB::HDBManager::busEntryIDs(), ExecutionTrace::busWriteCount(), HDB::HDBManager::canRemoveFUArchitecture(), HDB::HDBManager::canRemoveRFArchitecture(), DSDBManager::configuration(), DSDBManager::configurationId(), DSDBManager::configurationIDs(), HDB::HDBManager::containsFUArchitecture(), HDB::HDBManager::containsImplementationFile(), HDB::HDBManager::containsOperation(), HDB::HDBManager::containsRFArchitecture(), HDB::HDBManager::costEstimationData(), HDB::CachedHDBManager::costEstimationDataIDs(), HDB::HDBManager::costEstimationDataIDs(), HDB::HDBManager::costEstimationDataValue(), HDB::HDBManager::costFunctionPluginByID(), HDB::HDBManager::costFunctionPluginDataIDs(), HDB::HDBManager::costFunctionPluginIDs(), HDB::HDBManager::createCostFunctionOfFU(), HDB::HDBManager::createCostFunctionOfRF(), HDB::HDBManager::createImplementationOfFU(), HDB::HDBManager::createImplementationOfRF(), DSDBManager::cycleCount(), DSDBManager::energyEstimate(), HDB::HDBManager::fuArchitectureID(), HDB::HDBManager::fuArchitectureIDs(), HDB::HDBManager::fuArchitectureIDsByOperationSet(), HDB::HDBManager::fuByEntryID(), HDB::HDBManager::fuCostEstimationData(), HDB::HDBManager::fuCostEstimationDataIDs(), HDB::HDBManager::fuEntriesByArchitecture(), HDB::HDBManager::fuEntryHasArchitecture(), HDB::HDBManager::fuEntryIDOfImplementation(), HDB::HDBManager::fuEntryIDs(), ExecutionTrace::functionUnitOperationTriggerCounts(), DSDBManager::hasApplication(), DSDBManager::hasArchitecture(), HDB::HDBManager::hasBusEntry(), HDB::HDBManager::hasColumn(), DSDBManager::hasConfiguration(), HDB::HDBManager::hasCostEstimationDataByID(), HDB::HDBManager::hasCostFunctionPluginByID(), DSDBManager::hasCycleCount(), DSDBManager::hasEnergyEstimate(), HDB::HDBManager::hasFUEntry(), DSDBManager::hasImplementation(), HDB::HDBManager::hasRFEntry(), HDB::HDBManager::hasSocketEntry(), DSDBManager::implementationString(), ExecutionTrace::instructionExecutions(), DSDBManager::isUnschedulable(), DSDBManager::longestPathDelayEstimate(), HDB::HDBManager::OperationImplementationByID(), HDB::HDBManager::OperationImplementationIDs(), HDB::HDBManager::OperationImplementationResourceByID(), HDB::HDBManager::OperationImplementationResourceIDs(), DSDBManager::paretoSetConnectivityAndCycles(), ExecutionTrace::registerFileAccessCounts(), HDB::HDBManager::removeBusEntry(), HDB::HDBManager::removeFUEntry(), HDB::HDBManager::removeOperationImplementation(), HDB::HDBManager::removeOperationImplementationResource(), HDB::HDBManager::removeRFEntry(), HDB::HDBManager::removeSocketEntry(), HDB::HDBManager::resolveArchitecturePort(), HDB::HDBManager::rfArchitectureByID(), HDB::HDBManager::rfArchitectureID(), HDB::HDBManager::rfArchitectureIDs(), HDB::HDBManager::rfByEntryID(), HDB::HDBManager::rfCostEstimationData(), HDB::HDBManager::rfCostEstimationDataIDs(), HDB::HDBManager::rfEntriesByArchitecture(), HDB::HDBManager::rfEntryHasArchitecture(), HDB::HDBManager::rfEntryIDOfImplementation(), HDB::HDBManager::rfEntryIDs(), ExecutionTrace::simulatedCycleCount(), HDB::HDBManager::socketCostEstimationData(), HDB::HDBManager::socketCostEstimationDataIDs(), HDB::HDBManager::socketCostEstimationDataList(), HDB::HDBManager::socketEntryIDs(), and ExecutionTrace::socketWriteCount().

◆ rollback()

void RelationalDBConnection::rollback ( )
pure virtual

◆ rowCountInTable()

int RelationalDBConnection::rowCountInTable ( const std::string &  tableName)
pure virtual

Return number of entries in the given table.

Parameters
tableNameName of the table.
Returns
Number of entries in table.
Exceptions
RelationalDBExceptionIn case a database error occurred, call was made in the middle of an active transaction or the table does not exists.

Implemented in SQLiteConnection.

Definition at line 136 of file RelationalDBConnection.cc.

136  {
137  return false;
138 }

◆ tableExistsInDB()

bool RelationalDBConnection::tableExistsInDB ( const std::string &  tableName)
pure virtual

Checks if database has given table by name.

Parameters
tableNameName of the table
Returns
True if db has the table. Otherwise false.
Exceptions
RelationalDBExceptionIn case a database error occurred or call was made in the middle of an active transaction.

Implemented in SQLiteConnection.

Definition at line 122 of file RelationalDBConnection.cc.

122  {
123  return false;
124 }

Referenced by HDB::HDBManager::addRFExternalPortsToImplementation(), HDB::HDBManager::addRFImplementation(), HDB::HDBManager::addRFParametersToImplementation(), HDB::HDBManager::OperationImplementationByID(), and HDB::HDBManager::removeRFImplementation().

◆ updateQuery()

int RelationalDBConnection::updateQuery ( const std::string &  queryString)
pure virtual

Performs a query that changes the database (UPDATE/INSERT/DELETE).

Does not autocommit the changes in case the update is in the middle of transaction.

Parameters
queryStringThe query string.
Returns
Number of rows affected by the change.
Exceptions
RelationalDBExceptionIn case a database error occured.

Implemented in SQLiteConnection.

Definition at line 54 of file RelationalDBConnection.cc.

54  {
55  return 0;
56 }

Referenced by DSDBManager::addApplication(), DSDBManager::addArchitecture(), HDB::HDBManager::addBlockImplementationFileToHDB(), HDB::HDBManager::addBooleanColumn(), ExecutionTrace::addBusActivity(), HDB::HDBManager::addBusCostEstimationData(), HDB::HDBManager::addBusEntry(), ExecutionTrace::addBusWriteCount(), ExecutionTrace::addConcurrentRegisterFileAccessCount(), DSDBManager::addConfiguration(), HDB::HDBManager::addCostEstimationData(), HDB::HDBManager::addCostFunctionPlugin(), DSDBManager::addCycleCount(), DSDBManager::addEnergyEstimate(), HDB::HDBManager::addFUArchitecture(), HDB::HDBManager::addFUCostEstimationData(), HDB::HDBManager::addFUEntry(), HDB::HDBManager::addFUImplementation(), ExecutionTrace::addFunctionUnitOperationTriggerCount(), DSDBManager::addImplementation(), ExecutionTrace::addInstructionExecution(), ExecutionTrace::addInstructionExecutionCount(), HDB::HDBManager::addOperationImplementation(), HDB::HDBManager::addOperationImplementationResource(), ExecutionTrace::addProcedureAddressRange(), ExecutionTrace::addRegisterAccessCount(), HDB::HDBManager::addRFArchitecture(), HDB::HDBManager::addRFCostEstimationData(), HDB::HDBManager::addRFEntry(), HDB::HDBManager::addRFImplementation(), HDB::HDBManager::addSocketCostEstimationData(), HDB::HDBManager::addSocketEntry(), ExecutionTrace::addSocketWriteCount(), HDB::HDBManager::HDBManager(), ExecutionTrace::initialize(), HDB::HDBManager::insertFileFormats(), HDB::HDBManager::modifyCostEstimationData(), HDB::HDBManager::modifyCostFunctionPlugin(), DSDBManager::removeApplication(), HDB::HDBManager::removeBusEntry(), DSDBManager::removeConfiguration(), HDB::HDBManager::removeCostEstimationData(), HDB::HDBManager::removeCostFunctionPlugin(), HDB::HDBManager::removeFUArchitecture(), HDB::HDBManager::removeFUEntry(), HDB::HDBManager::removeFUImplementation(), HDB::HDBManager::removeOperationImplementation(), HDB::HDBManager::removeOperationImplementationResource(), HDB::HDBManager::removeRFArchitecture(), HDB::HDBManager::removeRFEntry(), HDB::HDBManager::removeRFImplementation(), HDB::HDBManager::removeSocketEntry(), HDB::HDBManager::setArchitectureForFU(), HDB::HDBManager::setArchitectureForRF(), DSDBManager::setAreaEstimate(), HDB::HDBManager::setCostFunctionPluginForFU(), HDB::HDBManager::setCostFunctionPluginForRF(), DSDBManager::setLongestPathDelayEstimate(), ExecutionTrace::setSimulatedCycleCount(), DSDBManager::setUnschedulable(), HDB::HDBManager::unsetArchitectureForFU(), HDB::HDBManager::unsetArchitectureForRF(), HDB::HDBManager::unsetCostFunctionPluginForFU(), and HDB::HDBManager::unsetCostFunctionPluginForRF().

◆ updateVersion()

void RelationalDBConnection::updateVersion ( int  version)
pure virtual

Set database version number.

Parameters
versionNew database version.

Implemented in SQLiteConnection.

Definition at line 156 of file RelationalDBConnection.cc.

156  {
157  (void)version;
158 }

References version().

Referenced by HDB::HDBManager::HDBManager().

Here is the call graph for this function:

◆ version()

int RelationalDBConnection::version ( )
pure virtual

Return database version number.

Returns
Database version.

Implemented in SQLiteConnection.

Definition at line 146 of file RelationalDBConnection.cc.

146  {
147  return 0;
148 }

Referenced by HDB::HDBManager::HDBManager(), and updateVersion().


The documentation for this class was generated from the following files:
RelationalDBConnection::version
virtual int version()=0
Definition: RelationalDBConnection.cc:146