diff options
author | root <root> | 2007-12-08 14:27:38 +0000 |
---|---|---|
committer | root <root> | 2007-12-08 14:27:38 +0000 |
commit | 57e6fe17689de1646a53a20a46374936391db3e2 (patch) | |
tree | 8db7b035c9650fe2f4042dc5749e724fda6fca76 /ev.pod | |
parent | 480621758fe1687120978562a553920ed46e1b7e (diff) |
fix c++ interface
Diffstat (limited to 'ev.pod')
-rw-r--r-- | ev.pod | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1846,14 +1846,21 @@ Example: simple class declaration and watcher initialisation ev::io iow; iow.set <myclass, &myclass::io_cb> (&obj); -=item w->set (void (*function)(watcher &w, int), void *data = 0) +=item w->set<function> (void *data = 0) Also sets a callback, but uses a static method or plain function as callback. The optional C<data> argument will be stored in the watcher's C<data> member and is free for you to use. +The prototype of the C<function> must be C<void (*)(ev::TYPE &w, int)>. + See the method-C<set> above for more details. +Example: + + static void io_cb (ev::io &w, int revents) { } + iow.set <io_cb> (); + =item w->set (struct ev_loop *) Associates a different C<struct ev_loop> with this watcher. You can only |