Has anyone come across a relatively simple event management class that can be used in a console application?
Here is what I want to do:
(1) The main function would wait for event and dispatch the actions based on event type:
Code:
main()
{
while (event) {
do something
}
}
(2) The events would be triggered by various functions implemented in the application, eg.
Code:
function1()
{
trigger event1
}
callback1()
{
trigger event2
}
Typical scenario that the app will be running is something like this:
generate event (read stdin) -> do something that returns callback -> callback triggers next event (eg. next line from stdin) -> do something that returns another callback -> ...
This is supposed to be a multi-platform app so I would like to keep it close to standard C++