diff options
-rw-r--r-- | sim/eventq.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sim/eventq.hh b/sim/eventq.hh index 31bf9d652..60a61fa29 100644 --- 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 */ |