changeset 983b71bfc1bd in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=983b71bfc1bd
description:
        Clean up the SimpleTimingPort class a little bit.
        Move the constructor into the .cc file and get rid of the typedef for
        SendEvent.

diffstat:

2 files changed, 7 insertions(+), 1 deletion(-)
src/mem/tport.cc |    7 +++++++
src/mem/tport.hh |    1 -

diffs (56 lines):

diff -r 27c1d1048c65 -r 983b71bfc1bd src/mem/tport.cc
--- a/src/mem/tport.cc  Mon Nov 10 11:51:18 2008 -0800
+++ b/src/mem/tport.cc  Mon Nov 10 11:51:18 2008 -0800
@@ -29,6 +29,21 @@
  */
 
 #include "mem/tport.hh"
+
+using namespace std;
+
+SimpleTimingPort::SimpleTimingPort(string pname, MemObject *_owner)
+    : Port(pname, _owner), sendEvent(0), drainEvent(NULL),
+      waitingOnRetry(false)
+{
+    sendEvent =  new EventWrapper<SimpleTimingPort,
+        &SimpleTimingPort::processSendEvent>(this);
+}
+
+SimpleTimingPort::~SimpleTimingPort()
+{
+    delete sendEvent;
+}
 
 bool
 SimpleTimingPort::checkFunctional(PacketPtr pkt)
diff -r 27c1d1048c65 -r 983b71bfc1bd src/mem/tport.hh
--- a/src/mem/tport.hh  Mon Nov 10 11:51:18 2008 -0800
+++ b/src/mem/tport.hh  Mon Nov 10 11:51:18 2008 -0800
@@ -85,9 +85,6 @@
      * When the event time expires it attempts to send the packet.
      * If it cannot, the packet sent when recvRetry() is called.
      **/
-    typedef EventWrapper<SimpleTimingPort, &SimpleTimingPort::processSendEvent>
-            SendEvent;
-
     Event *sendEvent;
 
     /** If we need to drain, keep the drain event around until we're done
@@ -155,15 +152,8 @@
 
 
   public:
-
-    SimpleTimingPort(std::string pname, MemObject *_owner)
-        : Port(pname, _owner),
-          sendEvent(new SendEvent(this)),
-          drainEvent(NULL),
-          waitingOnRetry(false)
-    {}
-
-    ~SimpleTimingPort() { delete sendEvent; }
+    SimpleTimingPort(std::string pname, MemObject *_owner);
+    ~SimpleTimingPort();
 
     /** Hook for draining timing accesses from the system.  The
      * associated SimObject's drain() functions should be implemented
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to