OpenASIP
2.0
src
base
program
NullAddress.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 NullAddress.cc
26
*
27
* Implementation of NullAddress class.
28
*
29
* @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
NullAddress.hh
"
34
#include "
NullAddressSpace.hh
"
35
36
using namespace
TTAMachine
;
37
38
namespace
TTAProgram
{
39
40
/////////////////////////////////////////////////////////////////////////////
41
// NullAddress
42
/////////////////////////////////////////////////////////////////////////////
43
44
NullAddress NullAddress::instance_;
45
46
/**
47
* The constructor.
48
*/
49
NullAddress::NullAddress() :
50
Address
(0,
NullAddressSpace
::instance()) {
51
}
52
53
/**
54
* The destructor.
55
*/
56
NullAddress::~NullAddress
() {
57
}
58
59
/**
60
* Returns an instance of NullAddress class (singleton).
61
*
62
* @return Singleton instance of NullAddress class.
63
*/
64
NullAddress
&
65
NullAddress::instance
() {
66
return
instance_
;
67
}
68
69
/**
70
* Aborts program with error log message.
71
*
72
* @return 0.
73
*/
74
UIntWord
75
NullAddress::location
()
const
{
76
abortWithError
(
"location()"
);
77
return
0;
78
}
79
80
/**
81
* Aborts program with error log message.
82
*
83
* @return A null address space.
84
*/
85
const
AddressSpace
&
86
NullAddress::space
()
const
{
87
abortWithError
(
"space()"
);
88
return
NullAddressSpace::instance();
89
}
90
91
}
TTAProgram
Definition:
Estimator.hh:65
UIntWord
Word UIntWord
Definition:
BaseType.hh:144
TTAProgram::NullAddress::~NullAddress
virtual ~NullAddress()
Definition:
NullAddress.cc:56
TTAProgram::Address
Definition:
Address.hh:51
TTAMachine::AddressSpace
Definition:
AddressSpace.hh:51
TTAProgram::NullAddress::space
const TTAMachine::AddressSpace & space() const
Definition:
NullAddress.cc:86
TTAProgram::NullAddress::location
UIntWord location() const
Definition:
NullAddress.cc:75
NullAddress.hh
TTAProgram::NullAddress::instance_
static NullAddress instance_
Definition:
NullAddress.hh:62
TTAProgram::NullAddress::instance
static NullAddress & instance()
Definition:
NullAddress.cc:65
TTAMachine::NullAddressSpace
Definition:
NullAddressSpace.hh:45
abortWithError
#define abortWithError(message)
Definition:
Application.hh:72
NullAddressSpace.hh
TTAProgram::NullAddress
Definition:
NullAddress.hh:45
TTAMachine
Definition:
Assembler.hh:48
Generated by
1.8.17