OpenASIP  2.0
EntryKeyProperty.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 EntryKeyProperty.hh
26  *
27  * Declaration of EntryKeyProperty 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_ENTRY_KEY_PROPERTY_HH
35 #define TTA_ENTRY_KEY_PROPERTY_HH
36 
37 #include <vector>
38 #include <string>
39 
40 #include "Exception.hh"
41 
43 
44 
45 /**
46  * Represents a type of an CostDBEntryKey which contains types of its
47  * fields, that is, EntryKeyFields.
48  *
49  * Using the EntryKeyProperty usually includes finding of the specific
50  * EntryKeyProperty with Find(). Then the types of EntryKeyProperty's
51  * fields can be accessed using FieldProperty(). Creation of the types
52  * is done similarly using first Create() and then
53  * CreateFieldProperty().
54  *
55  * For each CostDBEntryKey an EntryKeyProperty should be assigned.
56  */
58 public:
60 
61  std::string name() const;
62  EntryKeyFieldProperty* createFieldProperty(std::string field);
63  EntryKeyFieldProperty* fieldProperty(std::string field) const;
64 
65  static EntryKeyProperty* create(std::string type);
66  static EntryKeyProperty* find(std::string type);
67  static void destroy();
68 
69 protected:
70  EntryKeyProperty(std::string propertyName);
71 
72 private:
73  /// Table of field types.
74  typedef std::vector<EntryKeyFieldProperty*> FieldPropertyTable;
75  /// Table of entry types.
76  typedef std::vector<EntryKeyProperty*> EntryPropertyTable;
77 
78  /// Entry type.
79  std::string name_;
80  /// Field types of the entry type.
82 
83  /// All known entry types.
85 
86  /// Copying not allowed.
88  /// Assignment not allowed.
90 };
91 
92 #include "EntryKeyProperty.icc"
93 
94 #endif
EntryKeyProperty.icc
EntryKeyFieldProperty
Definition: EntryKeyFieldProperty.hh:47
EntryKeyProperty::destroy
static void destroy()
Definition: EntryKeyProperty.cc:166
Exception.hh
EntryKeyProperty::create
static EntryKeyProperty * create(std::string type)
Definition: EntryKeyProperty.cc:125
EntryKeyProperty::EntryKeyProperty
EntryKeyProperty(std::string propertyName)
Definition: EntryKeyProperty.cc:51
EntryKeyProperty::operator=
EntryKeyProperty & operator=(const EntryKeyProperty &)
Assignment not allowed.
EntryKeyProperty::EntryPropertyTable
std::vector< EntryKeyProperty * > EntryPropertyTable
Table of entry types.
Definition: EntryKeyProperty.hh:76
EntryKeyProperty::name
std::string name() const
EntryKeyProperty
Definition: EntryKeyProperty.hh:57
EntryKeyProperty::~EntryKeyProperty
~EntryKeyProperty()
Definition: EntryKeyProperty.cc:59
EntryKeyProperty::name_
std::string name_
Entry type.
Definition: EntryKeyProperty.hh:79
EntryKeyProperty::FieldPropertyTable
std::vector< EntryKeyFieldProperty * > FieldPropertyTable
Table of field types.
Definition: EntryKeyProperty.hh:74
EntryKeyProperty::entryTypes_
static EntryPropertyTable entryTypes_
All known entry types.
Definition: EntryKeyProperty.hh:84
EntryKeyProperty::find
static EntryKeyProperty * find(std::string type)
Definition: EntryKeyProperty.cc:150
EntryKeyProperty::createFieldProperty
EntryKeyFieldProperty * createFieldProperty(std::string field)
Definition: EntryKeyProperty.cc:79
EntryKeyProperty::fieldProperty
EntryKeyFieldProperty * fieldProperty(std::string field) const
Definition: EntryKeyProperty.cc:104
EntryKeyProperty::entryFields_
FieldPropertyTable entryFields_
Field types of the entry type.
Definition: EntryKeyProperty.hh:81