libeio, Windows (was: Binding Libev to Digitalmars' D)

Marc Lehmann schmorp at schmorp.de
Tue Jun 3 07:15:29 CEST 2008


On Mon, Jun 02, 2008 at 10:57:07PM -0600, Tony Arcieri <tony at medioh.com> wrote:
> Also, any plans on providing a C++ interface to libeio?

I can slap an extern "C" somewhere in the header file. Actually, done
already, so the c++ interface would be the same as the C interface for now
:)

> project I'm interested to integrating it into and it'd be great to have a
> C++ face on it.

Well, C++ is fully compatrible with C libraries. What kind of functionality
would you like to have? Would you want to be able to specify objects
and methods instead of a callback and a data pointer?

This could be done trivially using wrapper functions (without variadic
templates, unfortunately, all provided mosty manually).

If you want, I could craft an example wrapper function that could be adapted.
Instead of:

   eio_unlink ("/etc", 0, cb, this);

You'd write this in C++ (example):

   eio_unlink ("/etc", 0, this, &class::method);

Or, if we moved the priority to the back and have it a default value:

   eio_unlink ("/etc", object, &class::method);

this would be slightly more natural then the C interface.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list