OpenASIP  2.0
StateLocator.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 StateLocator.hh
26  *
27  * Declaration of StateLocator class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_STATE_LOCATOR_HH
35 #define TTA_STATE_LOCATOR_HH
36 
37 #include <map>
38 
39 #include "Exception.hh"
40 
41 class StateData;
42 
43 namespace TTAMachine {
44  class MachinePart;
45 }
46 
47 /**
48  * Class that makes it possible to lookup state objects corresponding to
49  * MOM component instances.
50  */
51 class StateLocator {
52 public:
53  StateLocator();
54  virtual ~StateLocator();
55 
56  void addState(
57  const TTAMachine::MachinePart& momComponent,
58  StateData& state);
59  StateData& state(const TTAMachine::MachinePart& momComponent) const;
60 
61 private:
62  /// Copying not allowed.
63  StateLocator(const StateLocator&);
64  /// Assignment not allowed.
66 
67  /// State objects indexed by MOM components.
68  typedef std::map<const TTAMachine::MachinePart*, StateData*>
70 
71  /// Contains all the states indexed by MOM components.
73 };
74 
75 #endif
StateLocator::state
StateData & state(const TTAMachine::MachinePart &momComponent) const
Definition: StateLocator.cc:78
StateLocator::StateContainer
std::map< const TTAMachine::MachinePart *, StateData * > StateContainer
State objects indexed by MOM components.
Definition: StateLocator.hh:69
StateLocator::~StateLocator
virtual ~StateLocator()
Definition: StateLocator.cc:51
Exception.hh
StateLocator::operator=
StateLocator & operator=(const StateLocator &)
Assignment not allowed.
StateLocator::states_
StateContainer states_
Contains all the states indexed by MOM components.
Definition: StateLocator.hh:72
StateLocator::StateLocator
StateLocator()
Definition: StateLocator.cc:45
TTAMachine::MachinePart
Definition: MachinePart.hh:57
StateLocator
Definition: StateLocator.hh:51
StateLocator::addState
void addState(const TTAMachine::MachinePart &momComponent, StateData &state)
Definition: StateLocator.cc:61
StateData
Definition: StateData.hh:44
TTAMachine
Definition: Assembler.hh:48