OpenASIP 2.2
Loading...
Searching...
No Matches
CostDBEntry.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 CostDBEntry.hh
26 *
27 * Declaration of CostDBEntry class.
28 *
29 * @author Tommi Rantanen 2003 (tommi.rantanen-no.spam-tut.fi)
30 * @author Jari Mäntyneva 2005 (jari.mantyneva-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_COSTDB_ENTRY_HH
35#define TTA_COSTDB_ENTRY_HH
36
37
38#include <string>
39
40#include "CostDBEntryKey.hh"
41#include "CostDBEntryStats.hh"
42#include "EntryKeyField.hh"
44#include "Exception.hh"
45
46
47/**
48 * Represents an entry containing a key and statistics.
49 *
50 * Key means the properties of an entry that are used as a search key.
51 */
53public:
56 const CostDBEntry& entry1,
57 const CostDBEntry& entry2,
58 const EntryKeyField& weighter);
59 virtual ~CostDBEntry();
60 CostDBEntry* copy() const;
61
63 EntryKeyField keyFieldOfType(std::string type) const;
64 const EntryKeyProperty* type() const;
65
66 void replaceField(EntryKeyField* newField);
67 int fieldCount() const;
68 const EntryKeyField& field(int index) const;
69 bool isEqualKey(const CostDBEntry& entry) const;
70
71 void addStatistics(CostDBEntryStats* newStats);
72 int statisticsCount() const;
73 const CostDBEntryStats& statistics(int index) const;
74
75private:
76 /// Type definition for a table of statistics.
77 typedef std::vector<CostDBEntryStats*> StatsTable;
78
79 /// Key of the entry.
81 /// Statistics of the entry.
83
84 /// Copying not allowed.
86 /// Assignment not allowed.
88};
89
90#endif
CostDBEntry & operator=(const CostDBEntry &)
Assignment not allowed.
int fieldCount() const
CostDBEntry * copy() const
const EntryKeyField & field(int index) const
StatsTable entryStats_
Statistics of the entry.
virtual ~CostDBEntry()
const EntryKeyProperty * type() const
CostDBEntry(const CostDBEntry &)
Copying not allowed.
CostDBEntryKey * entryKey_
Key of the entry.
void addStatistics(CostDBEntryStats *newStats)
EntryKeyField keyFieldOfType(const EntryKeyFieldProperty &type) const
void replaceField(EntryKeyField *newField)
const CostDBEntryStats & statistics(int index) const
bool isEqualKey(const CostDBEntry &entry) const
std::vector< CostDBEntryStats * > StatsTable
Type definition for a table of statistics.
int statisticsCount() const