OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
HDB::HDBEntry Class Referenceabstract

#include <HDBEntry.hh>

Inheritance diagram for HDB::HDBEntry:
Inheritance graph
Collaboration diagram for HDB::HDBEntry:
Collaboration graph

Public Member Functions

virtual ~HDBEntry ()
 
bool hasID () const
 
void setID (RowID id)
 
RowID id () const
 
virtual bool hasArchitecture () const =0
 
virtual bool hasImplementation () const =0
 
bool hasCostFunction () const
 
CostFunctionPlugincostFunction () const
 
void setCostFunction (CostFunctionPlugin *costFunction)
 
std::string hdbFile () const
 
void setHDBFile (const std::string &file)
 

Protected Member Functions

 HDBEntry ()
 

Private Attributes

bool hasID_
 Tells whether the entry has an ID set. More...
 
RowID id_
 ID of the entry in HDB. More...
 
CostFunctionPlugincostFunction_
 Cost function of the entry. More...
 
std::string hdbFile_
 The HDB file that contains the entry. More...
 

Detailed Description

An abstract base class for FUEntry and RFEntry.

Definition at line 46 of file HDBEntry.hh.

Constructor & Destructor Documentation

◆ ~HDBEntry()

HDB::HDBEntry::~HDBEntry ( )
virtual

The destructor.

Definition at line 49 of file HDBEntry.cc.

49  {
50  if (hasCostFunction()) {
51  delete costFunction_;
52  }
53 }

References costFunction_, and hasCostFunction().

Here is the call graph for this function:

◆ HDBEntry()

HDB::HDBEntry::HDBEntry ( )
protected

The constructor.

Definition at line 41 of file HDBEntry.cc.

41  :
42  hasID_(false), id_(0), costFunction_(NULL), hdbFile_("") {
43 }

Member Function Documentation

◆ costFunction()

CostFunctionPlugin & HDB::HDBEntry::costFunction ( ) const

Returns the cost function of the entry.

Returns
Cost function of the entry.
Exceptions
NotAvailableIf the entry doesn't have a cost function.

Definition at line 111 of file HDBEntry.cc.

111  {
112  if (!hasCostFunction()) {
113  throw NotAvailable(__FILE__, __LINE__, __func__);
114  }
115 
116  return *costFunction_;
117 }

References __func__, costFunction_, and hasCostFunction().

Referenced by CostDatabase::buildFunctionUnits(), CostDatabase::buildRegisterFiles(), CostEstimator::Estimator::fuCostFunctionPluginOfImplementation(), HDBToHtml::fuEntryToHtml(), CostEstimator::Estimator::rfCostFunctionPluginOfImplementation(), HDBToHtml::rfEntryToHtml(), and setCostFunction().

Here is the call graph for this function:

◆ hasArchitecture()

virtual bool HDB::HDBEntry::hasArchitecture ( ) const
pure virtual

Implemented in HDB::FUEntry, and HDB::RFEntry.

◆ hasCostFunction()

bool HDB::HDBEntry::hasCostFunction ( ) const

◆ hasID()

bool HDB::HDBEntry::hasID ( ) const

Tells whether the entry has an ID.

Returns
True if the entry has an ID, otherwise false.

Definition at line 62 of file HDBEntry.cc.

62  {
63  return hasID_;
64 }

References hasID_.

Referenced by HDB::HDBManager::addFUImplementation(), and id().

◆ hasImplementation()

virtual bool HDB::HDBEntry::hasImplementation ( ) const
pure virtual

Implemented in HDB::FUEntry, and HDB::RFEntry.

◆ hdbFile()

std::string HDB::HDBEntry::hdbFile ( ) const

Returns the HDB file that contains the entry.

Returns
The HDB file.

Definition at line 141 of file HDBEntry.cc.

141  {
142  return hdbFile_;
143 }

References hdbFile_.

◆ id()

RowID HDB::HDBEntry::id ( ) const

Returns the ID of the entry.

Returns
ID of the entry.

Definition at line 85 of file HDBEntry.cc.

85  {
86  if (!hasID()) {
87  throw NotAvailable(__FILE__, __LINE__, __func__);
88  } else {
89  return id_;
90  }
91 }

References __func__, hasID(), and id_.

Referenced by HDB::HDBManager::addFUImplementation(), SetRFArchitectureCmd::Do(), SetFUArchitectureCmd::Do(), AddRFImplementationCmd::Do(), HDBToHtml::fuEntryToHtml(), HDBToHtml::rfEntryToHtml(), and setID().

Here is the call graph for this function:

◆ setCostFunction()

void HDB::HDBEntry::setCostFunction ( CostFunctionPlugin costFunction)

Sets cost function for the entry.

Deletes the old cost function if one exists.

Parameters
costFunctionThe new cost function.

Definition at line 127 of file HDBEntry.cc.

127  {
128  if (hasCostFunction()) {
129  delete costFunction_;
130  }
132 }

References costFunction(), costFunction_, and hasCostFunction().

Referenced by HDB::HDBManager::fuByEntryID(), and HDB::HDBManager::rfByEntryID().

Here is the call graph for this function:

◆ setHDBFile()

void HDB::HDBEntry::setHDBFile ( const std::string &  file)

Sets the HDB file that contains the entry.

Parameters
fileThe HDB file.

Definition at line 152 of file HDBEntry.cc.

152  {
153  hdbFile_ = file;
154 }

References hdbFile_.

Referenced by HDB::HDBManager::fuByEntryID(), and HDB::HDBManager::rfByEntryID().

◆ setID()

void HDB::HDBEntry::setID ( RowID  id)

Sets the ID for the entry.

Parameters
idThe ID to set.

Definition at line 73 of file HDBEntry.cc.

73  {
74  hasID_ = true;
75  id_ = id;
76 }

References hasID_, id(), and id_.

Referenced by HDB::HDBManager::fuByEntryID(), and HDB::HDBManager::rfByEntryID().

Here is the call graph for this function:

Member Data Documentation

◆ costFunction_

CostFunctionPlugin* HDB::HDBEntry::costFunction_
private

Cost function of the entry.

Definition at line 73 of file HDBEntry.hh.

Referenced by costFunction(), hasCostFunction(), setCostFunction(), and ~HDBEntry().

◆ hasID_

bool HDB::HDBEntry::hasID_
private

Tells whether the entry has an ID set.

Definition at line 69 of file HDBEntry.hh.

Referenced by hasID(), and setID().

◆ hdbFile_

std::string HDB::HDBEntry::hdbFile_
private

The HDB file that contains the entry.

Definition at line 75 of file HDBEntry.hh.

Referenced by hdbFile(), and setHDBFile().

◆ id_

RowID HDB::HDBEntry::id_
private

ID of the entry in HDB.

Definition at line 71 of file HDBEntry.hh.

Referenced by id(), and setID().


The documentation for this class was generated from the following files:
HDB::HDBEntry::hasID
bool hasID() const
Definition: HDBEntry.cc:62
HDB::HDBEntry::hdbFile_
std::string hdbFile_
The HDB file that contains the entry.
Definition: HDBEntry.hh:75
HDB::HDBEntry::costFunction
CostFunctionPlugin & costFunction() const
Definition: HDBEntry.cc:111
HDB::HDBEntry::id
RowID id() const
Definition: HDBEntry.cc:85
NotAvailable
Definition: Exception.hh:728
HDB::HDBEntry::hasCostFunction
bool hasCostFunction() const
Definition: HDBEntry.cc:99
HDB::HDBEntry::costFunction_
CostFunctionPlugin * costFunction_
Cost function of the entry.
Definition: HDBEntry.hh:73
__func__
#define __func__
Definition: Application.hh:67
HDB::HDBEntry::hasID_
bool hasID_
Tells whether the entry has an ID set.
Definition: HDBEntry.hh:69
HDB::HDBEntry::id_
RowID id_
ID of the entry in HDB.
Definition: HDBEntry.hh:71