Previous Menu Next
Three Sets of Classes

This tutorial covers the three basic tasks you need to be familiar with:

Each of these tasks uses a different subset of the event annotation classes. However, both receiving events and annotation rely on the static class ECS and its public methods:

ECS::mainloop()
Monitors the underlying communication channels for activity and calls user-provided methods (eg in your override of ECS_EventReceiver.handleEvent()) as required. By default, mainloop() blocks until ECS::shutdown() is called, but there are optional parameters you can use to provide a timeout value.
ECS::poll()
Similar to mainloop() but non-blocking. By default, all outstanding events and messages are processed but there is an optional parameter you can use to ensure that only one event or message is processed before poll() returns.
ECS::shutdown()
A call to shutdown() terminates mainloop(), causing it to return. For example, ECS::shutdown may be used in a signal handler routine to terminate mainloop and cause the process to exit.