+ <dt>w->set<class, &class::method> (object *)</dt>
+ <dd>
+ <p>This method sets the callback method to call. The method has to have a
+signature of <code>void (*)(ev_TYPE &, int)</code>, it receives the watcher as
+first argument and the <code>revents</code> as second. The object must be given as
+parameter and is stored in the <code>data</code> member of the watcher.</p>
+ <p>This method synthesizes efficient thunking code to call your method from
+the C callback that libev requires. If your compiler can inline your
+callback (i.e. it is visible to it at the place of the <code>set</code> call and
+your compiler is good :), then the method will be fully inlined into the
+thunking function, making it as fast as a direct C callback.</p>
+ <p>Example: simple class declaration and watcher initialisation</p>
+<pre> struct myclass
+ {
+ void io_cb (ev::io &w, int revents) { }
+ }
+
+ myclass obj;
+ ev::io iow;
+ iow.set <myclass, &myclass::io_cb> (&obj);
+
+</pre>
+ </dd>
+ <dt>w->set<function> (void *data = 0)</dt>
+ <dd>
+ <p>Also sets a callback, but uses a static method or plain function as
+callback. The optional <code>data</code> argument will be stored in the watcher's
+<code>data</code> member and is free for you to use.</p>
+ <p>The prototype of the <code>function</code> must be <code>void (*)(ev::TYPE &w, int)</code>.</p>
+ <p>See the method-<code>set</code> above for more details.</p>
+ <p>Example:</p>
+<pre> static void io_cb (ev::io &w, int revents) { }
+ iow.set <io_cb> ();
+
+</pre>
+ </dd>