OpenASIP 2.2
Loading...
Searching...
No Matches
ReferenceKey.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 ReferenceKey.hh
26 *
27 * Declarations of different key types used in reference managing.
28 *
29 * @author Pekka Jääskeläinen 2003 (pjaaskel-no.spam-cs.tut.fi)
30 * @note reviewed 17 Oct 2003 by am, rm, kl
31 *
32 * @note rating: yellow
33 */
34#ifndef TTA_REFERENCEKEY_HH
35#define TTA_REFERENCEKEY_HH
36
37#include "TPEFBaseType.hh"
38
39namespace TPEF {
40namespace ReferenceManager {
41
42//////////////////////////////////////////////////////////////////////////////
43// ReferenceKey
44//////////////////////////////////////////////////////////////////////////////
45
46/**
47 * Base (interface) class for all keys that identify objects in
48 * reference manager.
49 */
51public:
52 virtual ~ReferenceKey();
53protected:
55};
56
57//////////////////////////////////////////////////////////////////////////////
58// SectionIndexKey
59//////////////////////////////////////////////////////////////////////////////
60
61/**
62 * With this type of key one can identify an object by means of a section
63 * identification code and the index of the element in the section.
64 */
66public:
68 virtual ~SectionIndexKey();
69
70 bool operator==(const SectionIndexKey& other) const;
71 bool operator!=(const SectionIndexKey& other) const;
72 bool operator<(const SectionIndexKey& other) const;
73
76
77private:
78 /// Section Identification code of the section that contains the element
79 /// this key points to.
81 /// Index of the element this key points to.
83};
84
85//////////////////////////////////////////////////////////////////////////////
86// SectionOffsetKey
87//////////////////////////////////////////////////////////////////////////////
88
89/**
90 * With this type of keys one can identify objects by means of a section
91 * identification code and a byte offset in the section.
92 */
94public:
96 virtual ~SectionOffsetKey();
97
100
101 bool operator==(const SectionOffsetKey& other) const;
102 bool operator!=(const SectionOffsetKey& other) const;
103 bool operator<(const SectionOffsetKey& other) const;
104
105private:
106 /// Identification code of the section that contains the element this
107 /// key points to.
109 /// Byte offset relative to section start to the element this key points
110 /// to.
112};
113
114//////////////////////////////////////////////////////////////////////////////
115// FileOffsetKey
116//////////////////////////////////////////////////////////////////////////////
117
118/**
119 * With this type of key one can identify objects with its file offset.
120 */
122public:
124 virtual ~FileOffsetKey();
125
126 bool operator==(const FileOffsetKey& other) const;
127 bool operator!=(const FileOffsetKey& other) const;
128 bool operator<(const FileOffsetKey& other) const;
129
131
132private:
133 /// File offset of the element this key points to.
135};
136
137///////////////////////////////////////////////////////////////////////////////
138// SectionKey
139///////////////////////////////////////////////////////////////////////////////
140
141/**
142 * With this type of key one can identify (section) objects with an
143 * arbitrary numeric code that is unique among all objects.
144 */
145class SectionKey : public ReferenceKey {
146public:
147
149 virtual ~SectionKey();
150
151 bool operator==(const SectionKey& other) const;
152 bool operator!=(const SectionKey& other) const;
153 bool operator<(const SectionKey& other) const;
154
156
157private:
158 /// Identification code of the section that contains the element this
159 /// key points to.
161};
162
163} // namespace ReferenceManager
164}
165
166#include "ReferenceKey.icc"
167
168#endif
169
bool operator!=(const FileOffsetKey &other) const
bool operator<(const FileOffsetKey &other) const
FileOffset fileOffset_
File offset of the element this key points to.
bool operator==(const FileOffsetKey &other) const
bool operator!=(const SectionIndexKey &other) const
bool operator==(const SectionIndexKey &other) const
SectionId sectionId_
Section Identification code of the section that contains the element this key points to.
SectionIndex index_
Index of the element this key points to.
bool operator<(const SectionIndexKey &other) const
bool operator==(const SectionKey &other) const
SectionId sectionId_
Identification code of the section that contains the element this key points to.
bool operator!=(const SectionKey &other) const
bool operator<(const SectionKey &other) const
bool operator==(const SectionOffsetKey &other) const
SectionOffset offset_
Byte offset relative to section start to the element this key points to.
bool operator<(const SectionOffsetKey &other) const
SectionId sectionId_
Identification code of the section that contains the element this key points to.
bool operator!=(const SectionOffsetKey &other) const
HalfWord SectionId
Type for storing binary file section ids.
Word SectionIndex
Type for storing section indexes.
Word SectionOffset
Type for storing offsets relative to a given base offset value.
Word FileOffset
Type for storing absolute file offsets.