mthread
0.5.1
|
A 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 () |
Condition to be 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 | loop () |
Main loop. | |
virtual bool | on_event () |
Called when the even occurs. | |
Private Attributes | |
bool | trigger |
Becomes true when the event occurs; returns to false when the event has been handled. |
A Thread that only executes when a given event occurs.
bool EventHandler::condition | ( | ) | [protected, virtual] |
Condition to be 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 | ( | void | ) | [protected, virtual] |
bool EventHandler::on_event | ( | ) | [protected, virtual] |
Called when the even occurs.