This is a simple example illustrating the usage with C-like callback functions.
#include <eventxx>
#include <iostream>
#include <csignal>
void sighandler(int signum, short event, void* data)
{
unsigned &i = *(unsigned*)data;
std::cout << ++i << " interrupts, ";
if (i < 5) std::cout << "keep going...\n";
else
{
std::cout << "done!\n";
}
}
int main()
{
int var = 0;
return 0;
}
Event dispatcher.
Definition: eventxx:549
int dispatch(int flags=0)
Main dispatcher loop.
Definition: eventxx:764
int exit(const time &to=time())
Exit the dispatch() loop.
Definition: eventxx:778
void add(basic_event &e, int priority=DEFAULT_PRIORITY)
Adds an event to the dispatcher.
Definition: eventxx:588
This is the specialization of eventxx::signal for C-style callbacks.
Definition: eventxx:460