OpenASIP  2.0
HDBEntry.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file HDBEntry.hh
26  *
27  * Declaration of HDBEntry class.
28  *
29  * @author Lasse Laasonen 2006 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_HDB_ENTRY_HH
34 #define TTA_HDB_ENTRY_HH
35 
36 #include "DBTypes.hh"
37 #include "Exception.hh"
38 
39 namespace HDB {
40 
41 class CostFunctionPlugin;
42 
43 /**
44  * An abstract base class for FUEntry and RFEntry.
45  */
46 class HDBEntry {
47 public:
48  virtual ~HDBEntry();
49 
50  bool hasID() const;
51  void setID(RowID id);
52  RowID id() const;
53 
54  virtual bool hasArchitecture() const = 0;
55  virtual bool hasImplementation() const = 0;
56 
57  bool hasCostFunction() const;
60 
61  std::string hdbFile() const;
62  void setHDBFile(const std::string& file);
63 
64 protected:
65  HDBEntry();
66 
67 private:
68  /// Tells whether the entry has an ID set.
69  bool hasID_;
70  /// ID of the entry in HDB.
72  /// Cost function of the entry.
74  /// The HDB file that contains the entry.
75  std::string hdbFile_;
76 };
77 }
78 
79 #endif
80 
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
Definition: CostDatabase.hh:49
Exception.hh
HDB::HDBEntry::~HDBEntry
virtual ~HDBEntry()
Definition: HDBEntry.cc:49
HDB::HDBEntry::id
RowID id() const
Definition: HDBEntry.cc:85
HDB::HDBEntry
Definition: HDBEntry.hh:46
HDB::HDBEntry::HDBEntry
HDBEntry()
Definition: HDBEntry.cc:41
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDB::HDBEntry::hdbFile
std::string hdbFile() const
Definition: HDBEntry.cc:141
HDB::HDBEntry::hasCostFunction
bool hasCostFunction() const
Definition: HDBEntry.cc:99
HDB::HDBEntry::setID
void setID(RowID id)
Definition: HDBEntry.cc:73
DBTypes.hh
HDB::HDBEntry::setCostFunction
void setCostFunction(CostFunctionPlugin *costFunction)
Definition: HDBEntry.cc:127
HDB::HDBEntry::costFunction_
CostFunctionPlugin * costFunction_
Cost function of the entry.
Definition: HDBEntry.hh:73
HDB::HDBEntry::hasArchitecture
virtual bool hasArchitecture() const =0
HDB::HDBEntry::hasID_
bool hasID_
Tells whether the entry has an ID set.
Definition: HDBEntry.hh:69
HDB::HDBEntry::hasImplementation
virtual bool hasImplementation() const =0
HDB::HDBEntry::id_
RowID id_
ID of the entry in HDB.
Definition: HDBEntry.hh:71
HDB::CostFunctionPlugin
Definition: CostFunctionPlugin.hh:43
HDB::HDBEntry::setHDBFile
void setHDBFile(const std::string &file)
Definition: HDBEntry.cc:152