OpenASIP 2.2
Loading...
Searching...
No Matches
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
39namespace HDB {
40
41class CostFunctionPlugin;
42
43/**
44 * An abstract base class for FUEntry and RFEntry.
45 */
46class HDBEntry {
47public:
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
64protected:
65 HDBEntry();
66
67private:
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
int RowID
Type definition of row ID in relational databases.
Definition DBTypes.hh:37
virtual bool hasImplementation() const =0
RowID id_
ID of the entry in HDB.
Definition HDBEntry.hh:71
void setCostFunction(CostFunctionPlugin *costFunction)
Definition HDBEntry.cc:127
void setID(RowID id)
Definition HDBEntry.cc:73
CostFunctionPlugin * costFunction_
Cost function of the entry.
Definition HDBEntry.hh:73
bool hasCostFunction() const
Definition HDBEntry.cc:99
std::string hdbFile_
The HDB file that contains the entry.
Definition HDBEntry.hh:75
CostFunctionPlugin & costFunction() const
Definition HDBEntry.cc:111
virtual bool hasArchitecture() const =0
virtual ~HDBEntry()
Definition HDBEntry.cc:49
std::string hdbFile() const
Definition HDBEntry.cc:141
bool hasID_
Tells whether the entry has an ID set.
Definition HDBEntry.hh:69
bool hasID() const
Definition HDBEntry.cc:62
void setHDBFile(const std::string &file)
Definition HDBEntry.cc:152
RowID id() const
Definition HDBEntry.cc:85