OpenASIP  2.0
Connection.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 Connection.hh
26  *
27  * Declaration of Connection class.
28  *
29  * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30  * @note reviewed 11 Jun 2004 by am, pj, jn, ll
31  * @note rating: red
32  */
33 
34 #ifndef TTA_CONNECTION_HH
35 #define TTA_CONNECTION_HH
36 
37 #include <string>
38 
39 class ObjectState;
40 namespace TTAMachine {
41 
42 class Segment;
43 class Socket;
44 
45 /**
46  * Joins Bus and Socket objects if they are connected in the machine.
47  */
48 class Connection {
49 public:
51  ~Connection();
52  Segment* bus() const;
53  Socket* socket() const;
54 
55  ObjectState* saveState() const;
56 
57  /// ObjectState name for Connection.
58  static const std::string OSNAME_CONNECTION;
59  /// ObjectState attribute key for socket name.
60  static const std::string OSKEY_SOCKET;
61  /// ObjectState attribute key for bus name.
62  static const std::string OSKEY_BUS;
63  /// ObjectState attribute key for segment name.
64  static const std::string OSKEY_SEGMENT;
65 
66 private:
67  /// Socket which is connected to the bus.
69  /// Bus which is connected to the socket.
71 };
72 }
73 
74 #include "Connection.icc"
75 
76 #endif
TTAMachine::Connection::socket
Socket * socket() const
TTAMachine::Segment
Definition: Segment.hh:54
TTAMachine::Connection::~Connection
~Connection()
Definition: Connection.cc:68
ObjectState
Definition: ObjectState.hh:59
TTAMachine::Connection::bus_
Segment * bus_
Bus which is connected to the socket.
Definition: Connection.hh:70
TTAMachine::Connection::bus
Segment * bus() const
TTAMachine::Socket
Definition: Socket.hh:53
TTAMachine::Connection::Connection
Connection(Socket &socket, Segment &bus)
Definition: Connection.cc:58
TTAMachine::Connection::OSKEY_BUS
static const std::string OSKEY_BUS
ObjectState attribute key for bus name.
Definition: Connection.hh:62
TTAMachine::Connection
Definition: Connection.hh:48
TTAMachine::Connection::OSKEY_SEGMENT
static const std::string OSKEY_SEGMENT
ObjectState attribute key for segment name.
Definition: Connection.hh:64
TTAMachine::Connection::socket_
Socket * socket_
Socket which is connected to the bus.
Definition: Connection.hh:68
TTAMachine::Connection::saveState
ObjectState * saveState() const
Definition: Connection.cc:85
TTAMachine
Definition: Assembler.hh:48
Connection.icc
TTAMachine::Connection::OSKEY_SOCKET
static const std::string OSKEY_SOCKET
ObjectState attribute key for socket name.
Definition: Connection.hh:60
TTAMachine::Connection::OSNAME_CONNECTION
static const std::string OSNAME_CONNECTION
ObjectState name for Connection.
Definition: Connection.hh:58