port.hh (14189:a363edac6a12) port.hh (14190:74c7a99c8b8c)
1/*
2 * Copyright (c) 2011-2012,2015,2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 112 unchanged lines hidden (view full) ---

121 unbind()
122 {
123 _peer = nullptr;
124 _connected = false;
125 }
126
127 /** Is this port currently connected to a peer? */
128 bool isConnected() const { return _connected; }
1/*
2 * Copyright (c) 2011-2012,2015,2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 112 unchanged lines hidden (view full) ---

121 unbind()
122 {
123 _peer = nullptr;
124 _connected = false;
125 }
126
127 /** Is this port currently connected to a peer? */
128 bool isConnected() const { return _connected; }
129
130 /** A utility function to make it easier to swap out ports. */
131 void
132 takeOverFrom(Port *old)
133 {
134 assert(old);
135 assert(old->isConnected());
136 assert(!isConnected());
137 Port &peer = old->getPeer();
138 assert(peer.isConnected());
139
140 // Disconnect the original binding.
141 old->unbind();
142 peer.unbind();
143
144 // Connect the new binding.
145 peer.bind(*this);
146 bind(peer);
147 }
129};
130
131#endif //__SIM_PORT_HH__
148};
149
150#endif //__SIM_PORT_HH__