A small event loop built in C++