|
mthread 0.5
|
Thread that only executes when a given event occurs. More...
#include <mthread.h>
Public Member Functions | |
| EventHandler () | |
| Constructor. | |
| virtual | ~EventHandler () |
| Destructor. | |
Protected Member Functions | |
| virtual bool | condition () |
| Evaluated on each call to determine whether or not to run the event. | |
| bool | loop () |
| Main loop. | |
| virtual bool | on_event () |
| called automatically when condition() evaluates true. | |
Private Attributes | |
| bool | trigger |
| Set to true when the condition evaluates true, returns to false when the event has been handled. | |
Thread that only executes when a given event occurs.
| bool EventHandler::condition | ( | ) | [protected, virtual] |
Evaluated on each call to determine whether or not to run the event.
The condition will not be checked again until the on_event() function returns false.
| bool EventHandler::loop | ( | ) | [protected, virtual] |
| bool EventHandler::on_event | ( | ) | [protected, virtual] |
called automatically when condition() evaluates true.
1.7.3