OpenASIP  2.0
CostDBEntryKey.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 CostDBEntryKey.hh
26  *
27  * Declaration of CostDBEntryKey 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_KEY_HH
35 #define TTA_COSTDB_ENTRY_KEY_HH
36 
37 
38 #include <string>
39 #include <vector>
40 
41 #include "CostDBTypes.hh"
42 #include "EntryKeyField.hh"
43 #include "Exception.hh"
44 
45 
46 /**
47  * Represents the key of the CostDBEntry.
48  *
49  * Key properties are the properties of an entry that are used as a
50  * search key.
51  */
53 public:
54  CostDBEntryKey(const EntryKeyProperty* entryType);
55  virtual ~CostDBEntryKey();
56  CostDBEntryKey* copy() const;
57 
58  const EntryKeyProperty* type() const;
59  EntryKeyField keyFieldOfType(const EntryKeyFieldProperty& fieldType) const;
60  EntryKeyField keyFieldOfType(std::string fieldType) const;
61  bool isEqual(const CostDBEntryKey& entryKey) const;
62 
64  void replaceField(EntryKeyField* newField);
65  int fieldCount() const;
66  const EntryKeyField& field(int index) const;
67 
68 private:
69  /// Table of entry fields.
70  typedef std::vector<EntryKeyField*> FieldTable;
71 
72  /// Type of the entry key.
74  /// Fields of the entry key.
76 
77  /// Copying not allowed.
79  /// Assignment not allowed.
81 };
82 
83 #include "CostDBEntryKey.icc"
84 
85 #endif
EntryKeyFieldProperty
Definition: EntryKeyFieldProperty.hh:47
CostDBTypes.hh
CostDBEntryKey::type
const EntryKeyProperty * type() const
Exception.hh
CostDBEntryKey::CostDBEntryKey
CostDBEntryKey(const EntryKeyProperty *entryType)
Definition: CostDBEntryKey.cc:43
CostDBEntryKey::fieldCount
int fieldCount() const
EntryKeyField
Definition: EntryKeyField.hh:45
CostDBEntryKey::fields_
FieldTable fields_
Fields of the entry key.
Definition: CostDBEntryKey.hh:75
CostDBEntryKey::type_
const EntryKeyProperty * type_
Type of the entry key.
Definition: CostDBEntryKey.hh:73
CostDBEntryKey::~CostDBEntryKey
virtual ~CostDBEntryKey()
Definition: CostDBEntryKey.cc:52
CostDBEntryKey::replaceField
void replaceField(EntryKeyField *newField)
Definition: CostDBEntryKey.cc:105
CostDBEntryKey::addField
void addField(EntryKeyField *field)
Definition: CostDBEntryKey.cc:88
CostDBEntryKey::isEqual
bool isEqual(const CostDBEntryKey &entryKey) const
Definition: CostDBEntryKey.cc:152
CostDBEntryKey::field
const EntryKeyField & field(int index) const
Definition: CostDBEntryKey.cc:181
CostDBEntryKey::FieldTable
std::vector< EntryKeyField * > FieldTable
Table of entry fields.
Definition: CostDBEntryKey.hh:70
EntryKeyProperty
Definition: EntryKeyProperty.hh:57
CostDBEntryKey.icc
CostDBEntryKey::copy
CostDBEntryKey * copy() const
Definition: CostDBEntryKey.cc:69
CostDBEntryKey::keyFieldOfType
EntryKeyField keyFieldOfType(const EntryKeyFieldProperty &fieldType) const
Definition: CostDBEntryKey.cc:123
EntryKeyField.hh
CostDBEntryKey
Definition: CostDBEntryKey.hh:52
CostDBEntryKey::operator=
CostDBEntryKey & operator=(const CostDBEntryKey &)
Assignment not allowed.