diff options
author | root <root> | 2008-12-03 15:23:44 +0000 |
---|---|---|
committer | root <root> | 2008-12-03 15:23:44 +0000 |
commit | c80a9f5d507071c8ca31b8134f2a1662f306ef28 (patch) | |
tree | aaf034c7a4d424efb43057688289ad46418ca350 /ev.pod | |
parent | 0b28ac4571929a861fbacc5ce9c61de21395debd (diff) |
*** empty log message ***
Diffstat (limited to 'ev.pod')
-rw-r--r-- | ev.pod | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -2893,6 +2893,36 @@ Example: simple class declaration and watcher initialisation ev::io iow; iow.set <myclass, &myclass::io_cb> (&obj); +=item w->set (object *) + +This is an B<experimental> 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<operator ()>, which makes it possible to use +functor objects without having to manually specify the C<operator ()> all +the time. Incidentally, you can then also leave out the template argument +list. + +The C<operator ()> method prototype must be C<void operator ()(watcher &w, +int revents)>. + +See the method-C<set> 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<function> (void *data = 0) Also sets a callback, but uses a static method or plain function as |