--- gvpe/src/iom.h 2003/03/21 23:17:01 1.4 +++ gvpe/src/iom.h 2003/03/26 01:58:46 1.5 @@ -35,7 +35,7 @@ class io_manager { vector pfs; - vector iow; + vector iow; vector tw; // actually a heap void idle_cb (tstamp &ts); time_watcher *idle; @@ -43,9 +43,9 @@ // register a watcher void reg (int fd, short events, io_watcher *w); - void unreg (io_watcher *w); + void unreg (const io_watcher *w); void reg (time_watcher *w); - void unreg (time_watcher *w); + void unreg (const time_watcher *w); void loop (); @@ -64,13 +64,13 @@ // a proxy is a kind of recipe on how to call a specific class method struct proxy_base { - virtual R call (void *obj, void (object::*meth)(A), A arg) = 0; + virtual R call (void *obj, R (object::*meth)(A), A arg) = 0; }; template struct proxy : proxy_base { - virtual R call (void *obj, void (object::*meth)(A), A arg) + virtual R call (void *obj, R (object::*meth)(A), A arg) { - ((reinterpret_cast(obj)) ->* (reinterpret_cast(meth))) + ((reinterpret_cast(obj)) ->* (reinterpret_cast(meth))) (arg); } }; @@ -79,20 +79,20 @@ public: template - callback (O1 *object, void (O2::*method)(A)) + callback (O1 *object, R (O2::*method)(A)) { static proxy p; obj = reinterpret_cast(object); - meth = reinterpret_cast(method); + meth = reinterpret_cast(method); prxy = &p; } - R call(A arg) + R call(A arg) const { return prxy->call (obj, meth, arg); } - R operator ()(A arg) + R operator ()(A arg) const { return call (arg); } @@ -109,7 +109,7 @@ iom.reg (fd, events, this); } - void stop () + void stop () const { iom.unreg (this); } @@ -139,7 +139,7 @@ set (when); } - void stop () + void stop () const { iom.unreg (this); }