CXXFLAGS=-I.. -g -Wall
# Uncomment this if you have a fixed event_base_free().
# See http://www.mail-archive.com/libevent-users@monkey.org/msg00112.html
-#CXXFLAGS+=-DEVENT_BASE_FREE_FIX
+CXXFLAGS+=-DEVENT_BASE_FREE_FIX
LDFLAGS=-levent
targets=bench test-eof test-time test-weof trivial c-way functor-way \
#include <iostream>
#include <csignal>
-using eventxx::dispatcher;
-
struct handler
{
- dispatcher& d;
+ eventxx::dispatcher& d;
int i;
- handler(dispatcher& d): d(d), i(0) {}
+ handler(eventxx::dispatcher& d): d(d), i(0) {}
void operator() (int signum, short event)
{
if (i < 5) std::cout << "keep going...\n";
int main()
{
- dispatcher d;
+ eventxx::dispatcher d;
handler h(d);
eventxx::csignal sigev(SIGINT, sighandler, &h.i);
eventxx::signal< handler > e(SIGINT, h);