46 #ifndef __SIM_PORT_HH__ 47 #define __SIM_PORT_HH__ 146 static inline std::ostream &
153 #endif //__SIM_PORT_HH__ Ports are used to interface objects to each other.
Port & getPeer()
Return a reference to this port's peer.
PortID getId() const
Get the port id.
bool isConnected() const
Is this port currently connected to a peer?
Port * _peer
A pointer to this port's peer.
virtual ~Port()
Virtual destructor due to inheritance.
virtual void unbind()
Dettach from a peer port.
bool _connected
Whether this port is currently connected to a peer port.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Port(const std::string &_name, PortID _id)
Abstract base class for ports.
const PortID id
A numeric identifier to distinguish ports in a vector, and set to InvalidPortID in case this port is ...
void takeOverFrom(Port *old)
A utility function to make it easier to swap out ports.
const std::string portName
Descriptive name (for DPRINTF output)
virtual void bind(Port &peer)
Attach to a peer port.
const std::string name() const
Return port name (for DPRINTF).
static std::ostream & operator<<(std::ostream &os, const Port &port)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.