#include "base/trace.hh"
#include "mem/mem_object.hh"
-Port::Port(const std::string &_name, MemObject& _owner, PortID _id)
- : portName(_name), id(_id), owner(_owner)
+Port::Port(const std::string &_name, PortID _id)
+ : portName(_name), id(_id)
{
}
{
}
-BaseMasterPort::BaseMasterPort(const std::string& name, MemObject* owner,
- PortID _id)
- : Port(name, *owner, _id), _baseSlavePort(NULL)
+BaseMasterPort::BaseMasterPort(const std::string &name, PortID _id)
+ : Port(name, _id), _baseSlavePort(NULL)
{
}
return _baseSlavePort != NULL;
}
-BaseSlavePort::BaseSlavePort(const std::string& name, MemObject* owner,
- PortID _id)
- : Port(name, *owner, _id), _baseMasterPort(NULL)
+BaseSlavePort::BaseSlavePort(const std::string &name, PortID _id)
+ : Port(name, _id), _baseMasterPort(NULL)
{
}
/**
* Master port
*/
-MasterPort::MasterPort(const std::string& name, MemObject* owner, PortID _id)
- : BaseMasterPort(name, owner, _id), _slavePort(NULL)
+MasterPort::MasterPort(const std::string& name, MemObject* _owner, PortID _id)
+ : BaseMasterPort(name, _id), _slavePort(NULL), owner(*_owner)
{
}
/**
* Slave port
*/
-SlavePort::SlavePort(const std::string& name, MemObject* owner, PortID id)
- : BaseSlavePort(name, owner, id), _masterPort(NULL)
+SlavePort::SlavePort(const std::string& name, MemObject* _owner, PortID id)
+ : BaseSlavePort(name, id), _masterPort(NULL), owner(*_owner)
{
}
*/
const PortID id;
- /** A reference to the MemObject that owns this port. */
- MemObject& owner;
-
/**
* Abstract base class for ports
*
* @param _name Port name including the owners name
- * @param _owner The MemObject that is the structural owner of this port
* @param _id A port identifier for vector ports
*/
- Port(const std::string& _name, MemObject& _owner, PortID _id);
+ Port(const std::string& _name, PortID _id);
/**
* Virtual destructor due to inheritance.
BaseSlavePort* _baseSlavePort;
- BaseMasterPort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ BaseMasterPort(const std::string& name, PortID id=InvalidPortID);
virtual ~BaseMasterPort();
public:
BaseMasterPort* _baseMasterPort;
- BaseSlavePort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ BaseSlavePort(const std::string& name, PortID id=InvalidPortID);
virtual ~BaseSlavePort();
public:
SlavePort* _slavePort;
+ protected:
+
+ MemObject& owner;
+
public:
- MasterPort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ MasterPort(const std::string& name, MemObject* _owner,
+ PortID id=InvalidPortID);
virtual ~MasterPort();
/**
MasterPort* _masterPort;
+ protected:
+
+ MemObject& owner;
+
public:
- SlavePort(const std::string& name, MemObject* owner,
- PortID id = InvalidPortID);
+ SlavePort(const std::string& name, MemObject* _owner,
+ PortID id=InvalidPortID);
virtual ~SlavePort();
/**