Excuses about not throwing an exception on dispatcher's dispatch() and exit().
Since libevent don't specify very clearly when and what event_dispatch() and
event_exitloop() returns errors, I cannot specify precisely the exceptions to
throw, so the user must manage the error codes returned by itselfs until
libevent gets documented.
Use enums for several flags.
Now the event type symbols are enums (and have scope, so they are part of the
eventxx namespace). Same for the EVLOOP_* symbols, now are eventxx::*.
Fix priorities API.
Priorities were added in the event constructor, but event priority are reseted
by libevent when they are associated with an event_base (event_base_set()), so
it was useless. Now priorities are set in the dispatcher::add() method, so
event_priority_set() y called just after event_base_set() and we can be all
happy and have working priorities.
Rename event namespace to eventxx.
This renaming is for the sake of clarity, so libevent and eventxx don't get
confused (by the compiler, by the documentation tools, by the man page reader,
etc.).
Casting fixes.
When using function pointers (other than the libevent C API style callbacks),
the implicit cast doesn't work, so reinterpret_cast< void* > is used.
C++ wrapper for libevent.
This is a simple, direct, one-header inline C++ wrapper for libevent.
It's designed to be as close to use to libevent without compromising modern
C++ programming techniques and efficiency (since all implementation is
trivial and inline, theoretically, it imposes no overhead at all).