projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec06c63
)
Add a simple event wrapper class that takes a class pointer
author
Nathan Binkert
<binkertn@umich.edu>
Fri, 20 Feb 2004 20:24:21 +0000
(15:24 -0500)
committer
Nathan Binkert
<binkertn@umich.edu>
Fri, 20 Feb 2004 20:24:21 +0000
(15:24 -0500)
and member function and will schedule it for the future.
--HG--
extra : convert_revision :
f5c5a8df0839e1e10716850c2086862c4a5bc499
sim/eventq.hh
patch
|
blob
|
history
diff --git
a/sim/eventq.hh
b/sim/eventq.hh
index 31bf9d6527417e4df9f4648543d53289e40c00e4..60a61fa2981156ca79c1104c5d0b85bc54bcfa59 100644
(file)
--- a/
sim/eventq.hh
+++ b/
sim/eventq.hh
@@
-236,6
+236,20
@@
DelayFunction(Tick when, T *object)
new DelayEvent(when, object);
}
+template <class T, void (T::* F)()>
+class EventWrapper : public Event
+{
+ private:
+ T *object;
+
+ public:
+ EventWrapper(T *obj, EventQueue *q = &mainEventQueue,
+ Priority p = Default_Pri)
+ : Event(q, p), object(obj)
+ {}
+ void process() { (object->*F)(); }
+};
+
/*
* Queue of events sorted in time order
*/