SOMEEMan
- File stem
- eman
- Base
- SOMObject
- Metaclass
- SOMMSingleInstance
- Ancestor Classes
- SOMObject
- Description
The Event Manager class (EMan for short) is used to handle several input events. The main purpose of this class is to provide a service that can do a blocked (or timed) wait on several event sources concurrently. Typically, in a main program, one registers an interest in an event type with EMan and specifies a callback (a procedure or a method) to be invoked when the event of interest occurs. After all the necessary registrations are complete, the main program ends with a call to someProcessEvents in EMan. This call is non-returning. Eman then waits on all registered event sources. The application is completely event driven at this point (that is, it does something only when an event occurs). The control returns to EMan after processing each event. Further registrations can be done from within the callback routines. Unregistrations can also be done from within the callback routines.
For applications that want to have their own main loop, EMan provides a non-blocking call (the someProcessEvent method), which processes just one event (if any) and returns to the main loop immediately. Note that when this call is the only one in the application's main loop, CPU cycles are wasted in constantly polling for events. In this situation, the non-returning form of the someProcessEvents call is preferable.
AIX Specifics: On AIX this event manager supports Timer, Sink (any file, pipe, socket, or Message Queue), Client and WorkProc events.
OS/2 Specifics: On OS/2 this event manager supports Timer, Sink (sockets only), Client, and WorkProc events.
Thread Safety:
To cope with multi-threaded applications on OS/2, the event-manager methods are mutually exclusive (that is, at any time only one thread can be executing inside of EMan). If an application thread needs to stop EMan from running (that is, to achieve mutual exclusion with EMan), it can use the two methods someGetEmanSem and someReleaseEManSem to acquire and release EMan semaphore(s). On AIX, since AIX does not support threads (at present), calling these two methods has no effect.
- New methods
The following list shows all the SOMEEMan methods.
- someGetEmanSem
- someReleaseEManSem
- someChangeRegData
- someProcessEvent
- someProcessEvents
- someQueueEvent
- someRegister
- someRegisterEv
- someRegisterProc
- someShutdown
- someUnegister
- Overridden methods
The following list shows all the methods overridden by the SOMEEMan class. These methods are overridden in order to modify the behavior defined by an ancestor class.