Browse Prior Art Database

Portable Object-Oriented Event Manager

IP.com Disclosure Number: IPCOM000112983D
Original Publication Date: 1994-Jun-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 4 page(s) / 125K

Publishing Venue

IBM

Related People

Gest, SB: AUTHOR [+2]

Abstract

This document will describe a portable object-oriented Event Manager (EMan) that serves as a central facility for registering all events of an application in a system-independent manner. Currently, application writers requesting input from devices such as a keyboard or mouse, or from the operating system, must write code that is very platform or system dependent. This code must, in turn, be rewritten when porting to each successive platform, or when using a different graphical user interface toolkit. EMan is a platform-independent class for handling such application events, thus shielding the application writer from having to write different versions of code for different platforms.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 43% of the total text.

Portable Object-Oriented Event Manager

      This document will describe a portable object-oriented Event
Manager (EMan) that serves as a central facility for registering all
events of an application in a system-independent manner.  Currently,
application writers requesting input from devices such as a keyboard
or mouse, or from the operating system, must write code that is very
platform or system dependent.  This code must, in turn, be rewritten
when porting to each successive platform, or when using a different
graphical user interface toolkit.  EMan is a platform-independent
class for handling such application events, thus shielding the
application writer from having to write different versions of code
for different platforms.

      Eman is a System Object Model (SOM) class used by
object-oriented programmers that provides a platform-independent
layer for registering and dispatching system and user interface
events of interest to applications running on AIX*, OS/2*, and
Windows**.  The event management framework consists of an event
manager class (EMan), a registration data class, and several event
classes.  It provides a way to organize various application events
into groups and to process all events in a single single
event-processing loop.  The need for this kind of facility is seen
very clearly in interactive applications that also need to process
some background events (say, messages arriving from a remote
process).  Such applications must maintain contact with the user
while responding to events coming from other sources.

      One solution in a multi-threaded environment is to have a
different thread service each different source of events.  For a
single-threaded environment it should be possible to recognize and
process all events of interest in a single main loop.  EMan offers
precisely this capability.  EMan can be useful even when multiple
threads are available, because of its simple programming model.  It
avoids contention for common data objects between EMan event
processing and other main-loop processing activity.

      The programming model of EMan is similiar to that of many GUI
toolkits.  The main program initializes EMan and then registers
interest in various types of events.  The main program ends by
calling a non-returning method of EMan that waits for events and
dispatches them when they occur.  In short, the model includes steps
that:

1.  Initialize the event manager,

2.  Register with the event manager for all events of interest, and

3.  Hand over control to the event manager to loop forever and
    dispatch events.

      Currently, EMan supports the following kinds of events, for
which an application writer can register and unregister for, even
after control has been turned over to EMan.  Event types are
categorized as follows:

o   Timer events
    These can be either one-time timers or interval timers.

o   Sink events (sockets, file descriptors, and message queue...