On Jan 9, 2008 8:28 AM, Leandro Lucarella <[EMAIL PROTECTED]> wrote:
> Is not that is a lot of work typing (that, as painful as it is, it's done
> only once ;), but the lack of a base "class" to have a container of
> watchers.
>
> I thought about a lot of solutions, but all has their drawbacks:
>
> * "Interfaces": a pure virtual base class with the basic operations
> (start(), stop() mainly) and multiple inheritance for each watcher
> (like struct io: ev_io, base { ... };).
This is what I ended up doing in the Ruby binding. The Watcher base class
cannot be instantiated directly, instead only the subclasses can. Each
subclass implements attach and detach methods to add and remove it from a
loop.
--
Tony Arcieri
ClickCaster, Inc.
[EMAIL PROTECTED]
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev