OpenASIP 2.2
Loading...
Searching...
No Matches
NullAddressSpace.cc
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 NullAddressSpace.cc
26 *
27 * Implementation of NullAddressSpace class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: yellow
31 */
32
33#include "NullAddressSpace.hh"
34#include "Machine.hh"
35
36namespace TTAMachine {
37
39NullAddressSpace NullAddressSpace::instance_;
40
41/**
42 * The constructor.
43 */
45 AddressSpace("NULL", 1, 0, 1, machine_) {
46}
47
48
49/**
50 * The destructor.
51 */
54
55
56/**
57 * Returns the only instance of NullAddressSpace.
58 *
59 * @return The only instance of NullAddressSpace.
60 */
65
66
67/**
68 * Aborts the program with error message.
69 *
70 * @return Never returns.
71 */
72int
74 abortWithError("width()");
75 return 0;
76}
77
78
79/**
80 * Aborts the program with error message.
81 *
82 * @return Never returns.
83 */
86 abortWithError("start()");
87 return 0;
88}
89
90
91/**
92 * Aborts the program with error message.
93 *
94 * @return Never returns.
95 */
98 abortWithError("end()");
99 return 0;
100}
101
102
103/**
104 * Aborts the program with error message.
105 *
106 * @return Never returns.
107 */
110 abortWithError("name()");
111 return "";
112}
113
114
115/**
116 * Aborts the program with error message.
117 *
118 * @exception ComponentAlreadyExists Never thrown.
119 * @exception InvalidName Never thrown.
120 */
121void
122NullAddressSpace::setName(const std::string&) {
123 abortWithError("setName()");
124}
125
126/**
127 * Aborts the program with error message.
128 *
129 * @exception OutOfRange Never thrown.
130 */
131void
133 abortWithError("setWidth()");
134}
135
136/**
137 * Aborts the program with error message.
138 *
139 * @exception OutOfRange Never thrown.
140 */
141void
145
146/**
147 * Aborts the program with error message.
148 *
149 * @exception ComponentAlreadyExists Never thrown.
150 */
151void
155
156/**
157 * Aborts the program with error message.
158 */
159void
161 abortWithError("unsetMachine()");
162}
163
164
165/**
166 * Aborts the program with error message.
167 *
168 * @return Never returns.
169 */
170Machine*
172 abortWithError("machine()");
173 return NULL;
174}
175
176
177/**
178 * Aborts the program with error message.
179 *
180 * @exception IllegalRegistration Never thrown.
181 */
182void
184 abortWithError("ensureRegistration()");
185}
186
187/**
188 * Aborts the program with error message.
189 *
190 * @return Never returns.
191 */
192bool
194 abortWithError("isRegistered()");
195 return false;
196}
197
198
199/**
200 * Aborts the program with error message.
201 *
202 * @return Never returns.
203 */
206 abortWithError("saveState()");
207 return NULL;
208}
209
210
211/**
212 * Aborts the program with error message.
213 *
214 * @exception ObjectStateLoadingException Never thrown.
215 */
216void
218 abortWithError("loadState()");
219}
220}
#define abortWithError(message)
unsigned long ULongWord
Definition BaseType.hh:51
static NullAddressSpace & instance()
virtual void ensureRegistration(const Component &component) const
virtual bool isRegistered() const
virtual ObjectState * saveState() const
static Machine machine_
Machine to which the null address space is registered.
virtual void setAddressBounds(ULongWord start, ULongWord end) override
virtual void setWidth(int width) override
virtual Machine * machine() const
virtual void loadState(const ObjectState *state)
static NullAddressSpace instance_
The only instance of NullAddressSpace.
virtual TCEString name() const override
virtual void setMachine(Machine &mach) override
virtual ULongWord end() const
virtual void setName(const std::string &name) override
virtual ULongWord start() const