From c80a9f5d507071c8ca31b8134f2a1662f306ef28 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 3 Dec 2008 15:23:44 +0000 Subject: *** empty log message *** --- ev.pod | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'ev.pod') diff --git a/ev.pod b/ev.pod index 23942c0..a6f6854 100644 --- a/ev.pod +++ b/ev.pod @@ -2893,6 +2893,36 @@ Example: simple class declaration and watcher initialisation ev::io iow; iow.set (&obj); +=item w->set (object *) + +This is an B feature that might go away in a future version. + +This is a variation of a method callback - leaving out the method to call +will default the method to C, which makes it possible to use +functor objects without having to manually specify the C all +the time. Incidentally, you can then also leave out the template argument +list. + +The C method prototype must be C. + +See the method-C above for more details. + +Example: use a functor object as callback. + + struct myfunctor + { + void operator() (ev::io &w, int revents) + { + ... + } + } + + myfunctor f; + + ev::io w; + w.set (&f); + =item w->set (void *data = 0) Also sets a callback, but uses a static method or plain function as -- cgit v1.2.3