summaryrefslogtreecommitdiff
path: root/base/callback.hh
diff options
context:
space:
mode:
Diffstat (limited to 'base/callback.hh')
-rw-r--r--base/callback.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/base/callback.hh b/base/callback.hh
index eee629cf5..342ab7e0f 100644
--- a/base/callback.hh
+++ b/base/callback.hh
@@ -103,4 +103,17 @@ class CallbackQueue
}
};
+template <class T, void (T::* F)()>
+class MakeCallback : public Callback
+{
+ private:
+ T *object;
+
+ public:
+ MakeCallback(T *o)
+ : object(o)
+ { }
+ void process() { (object->*F)(); }
+};
+
#endif // __CALLBACK_HH__