event: Allow EventWrapper to take an object reference
authorNathan Binkert <nate@binkert.org>
Sun, 18 Apr 2010 20:23:24 +0000 (13:23 -0700)
committerNathan Binkert <nate@binkert.org>
Sun, 18 Apr 2010 20:23:24 +0000 (13:23 -0700)
src/sim/eventq.hh

index 1b00088a32c8a8445a78ccf88a35e8be9a5f84af..3869ca287163fd1f8b8d78adea1c85cd50c3e4e6 100644 (file)
@@ -577,6 +577,13 @@ class EventWrapper : public Event
             setFlags(AutoDelete);
     }
 
+    EventWrapper(T &obj, bool del = false, Priority p = Default_Pri)
+        : Event(p), object(&obj)
+    {
+        if (del)
+            setFlags(AutoDelete);
+    }
+
     void process() { (object->*F)(); }
 
     const std::string