OpenASIP  2.0
NullAddressSpace.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 NullAddressSpace.hh
26  *
27  * Declaration of NullAddressSpace class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: yellow
31  */
32 
33 #ifndef TTA_NULL_ADDRESS_SPACE_HH
34 #define TTA_NULL_ADDRESS_SPACE_HH
35 
36 #include "AddressSpace.hh"
37 
38 namespace TTAMachine {
39 
40 /**
41  * A singleton class which represents a null AddressSpace.
42  *
43  * All the methods abort the program.
44  */
46 public:
47  static NullAddressSpace& instance();
48 
49  virtual int width() const;
50  virtual ULongWord start() const;
51  virtual ULongWord end() const;
52 
53  virtual TCEString name() const override;
54  virtual void setName(const std::string& name) override;
55  virtual void setWidth(int width) override;
56  virtual void setAddressBounds(ULongWord start, ULongWord end) override;
57  virtual void setMachine(Machine& mach) override;
58  virtual void unsetMachine();
59  virtual Machine* machine() const;
60 
61  virtual void ensureRegistration(const Component& component) const;
62  virtual bool isRegistered() const;
63 
64  virtual ObjectState* saveState() const;
65  virtual void loadState(const ObjectState* state);
66 
67 private:
69  virtual ~NullAddressSpace();
70 
71  /// The only instance of NullAddressSpace.
73  /// Machine to which the null address space is registered.
74  static Machine machine_;
75 };
76 }
77 
78 #endif
TTAMachine::NullAddressSpace::instance
static NullAddressSpace & instance()
Definition: NullAddressSpace.cc:62
TTAMachine::NullAddressSpace::machine_
static Machine machine_
Machine to which the null address space is registered.
Definition: NullAddressSpace.hh:74
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
TTAMachine::NullAddressSpace::unsetMachine
virtual void unsetMachine()
Definition: NullAddressSpace.cc:160
AddressSpace.hh
TTAMachine::NullAddressSpace::~NullAddressSpace
virtual ~NullAddressSpace()
Definition: NullAddressSpace.cc:52
TTAMachine::NullAddressSpace::width
virtual int width() const
Definition: NullAddressSpace.cc:73
ObjectState
Definition: ObjectState.hh:59
TTAMachine::NullAddressSpace::NullAddressSpace
NullAddressSpace()
Definition: NullAddressSpace.cc:44
TTAMachine::NullAddressSpace::instance_
static NullAddressSpace instance_
The only instance of NullAddressSpace.
Definition: NullAddressSpace.hh:72
TTAMachine::NullAddressSpace::start
virtual ULongWord start() const
Definition: NullAddressSpace.cc:85
TTAMachine::NullAddressSpace::machine
virtual Machine * machine() const
Definition: NullAddressSpace.cc:171
TTAMachine::NullAddressSpace::loadState
virtual void loadState(const ObjectState *state)
Definition: NullAddressSpace.cc:217
TTAMachine::NullAddressSpace::setName
virtual void setName(const std::string &name) override
Definition: NullAddressSpace.cc:122
TTAMachine::NullAddressSpace
Definition: NullAddressSpace.hh:45
TTAMachine::NullAddressSpace::end
virtual ULongWord end() const
Definition: NullAddressSpace.cc:97
TTAMachine::Component
Definition: MachinePart.hh:90
TTAMachine::NullAddressSpace::name
virtual TCEString name() const override
Definition: NullAddressSpace.cc:109
TCEString
Definition: TCEString.hh:53
TTAMachine::NullAddressSpace::saveState
virtual ObjectState * saveState() const
Definition: NullAddressSpace.cc:205
ULongWord
unsigned long ULongWord
Definition: BaseType.hh:51
TTAMachine::NullAddressSpace::ensureRegistration
virtual void ensureRegistration(const Component &component) const
Definition: NullAddressSpace.cc:183
TTAMachine::NullAddressSpace::isRegistered
virtual bool isRegistered() const
Definition: NullAddressSpace.cc:193
TTAMachine
Definition: Assembler.hh:48
TTAMachine::NullAddressSpace::setMachine
virtual void setMachine(Machine &mach) override
Definition: NullAddressSpace.cc:152
TTAMachine::NullAddressSpace::setWidth
virtual void setWidth(int width) override
Definition: NullAddressSpace.cc:132
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::NullAddressSpace::setAddressBounds
virtual void setAddressBounds(ULongWord start, ULongWord end) override
Definition: NullAddressSpace.cc:142