From 57e6fe17689de1646a53a20a46374936391db3e2 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 8 Dec 2007 14:27:38 +0000 Subject: fix c++ interface --- ev.html | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'ev.html') diff --git a/ev.html b/ev.html index 738d6d0..d8909ea 100644 --- a/ev.html +++ b/ev.html @@ -6,7 +6,7 @@ - + @@ -771,8 +771,9 @@ it.

Returns a true value iff the watcher is pending, (i.e. it has outstanding events but its callback has not yet been invoked). As long as a watcher is pending (but not active) you must not call an init function on it (but -ev_TYPE_set is safe) and you must make sure the watcher is available to -libev (e.g. you cnanot free () it).

+ev_TYPE_set is safe), you must not change its priority, and you must +make sure the watcher is available to libev (e.g. you cannot free () +it).

callback ev_cb (ev_TYPE *watcher)
@@ -797,12 +798,26 @@ example, to reduce latency after idling, or more often, to bind two watchers on the same event and make sure one is called first.

If you need to suppress invocation when higher priority events are pending you need to look at ev_idle watchers, which provide this functionality.

+

You must not change the priority of a watcher as long as it is active or +pending.

The default priority used by watchers when no priority has been set is always 0, which is supposed to not be too high and not be too low :).

Setting a priority outside the range of EV_MINPRI to EV_MAXPRI is fine, as long as you do not mind that the priority value you query might or might not have been adjusted to be within valid range.

+
ev_invoke (loop, ev_TYPE *watcher, int revents)
+
+

Invoke the watcher with the given loop and revents. Neither +loop nor revents need to be valid as long as the watcher callback +can deal with that fact.

+
+
int ev_clear_pending (loop, ev_TYPE *watcher)
+
+

If the watcher is pending, this function returns clears its pending status +and returns its revents bitset (as if its callback was invoked). If the +watcher isn't pending it does nothing and returns 0.

+
@@ -1808,12 +1823,18 @@ thunking function, making it as fast as a direct C callback.

-
w->set (void (*function)(watcher &w, int), void *data = 0)
+
w->set<function> (void *data = 0)

Also sets a callback, but uses a static method or plain function as callback. The optional data argument will be stored in the watcher's data member and is free for you to use.

+

The prototype of the function must be void (*)(ev::TYPE &w, int).

See the method-set above for more details.

+

Example:

+
  static void io_cb (ev::io &w, int revents) { }
+  iow.set <io_cb> ();
+
+
w->set (struct ev_loop *)
-- cgit v1.2.3