# if !defined(PROCESSEVENT_H) # define PROCESSEVENT_H #include # if !defined OLC3COMMON_H # include "olc3common.h" # endif # if !defined EVENTINSTANCE_H # include "eventinstance.h" # endif # if !defined STATE_H # include "state.h" # endif /* ** There are several different types of processing you can choose: ** ** 1. Process events in event queue order ** 2. Process events in Active Instance queue order ** 3. Process events in Active Class queue order (ie. deal with ** the active instances in one active class before dealing ** with active instances in other classes) ** 4. Process events in random event order. Each of the first 20 ** events outstanding has an equal probability of being processed ** next. If there exist two events from the one active instance to ** another active instance and the the second event is chosen, the ** first will be processed. Choosing this mode of event processing ** could mean that some event never get processed because it is ** never lucky enough to be chosen. ** */ typedef enum { EventQueueOrder, ActiveInstanceQueueOrder, ActiveClassQueueOrder, RandomOrder } EventProcessingType; /* ** Whichever type of event processing you choose, the following rules ** ALWAYS apply. ** ** Events from active instance A to active instance B are recieved ** by B in the order that A sent them ** ** If active instance A sends an event X to active instance B and ** event Y to active instance C, whether B receives X before C receives Y ** or vice versa is undefined. ** ** If active instance A sends event X to active instance C and ** active instance B sends event Y to active instance C, whether C ** receives event X first or event Y first is undefined. */ /* ** When processing events you can ** ** 1. Process process all events ** 2. Process a specified number of events ** ** When processing in Active Instance order or Active Class order the number ** of events processed is the number of events per Active Instance. So, ** specifying two would indicate that each Active Instance would process two ** events. */ enum { ProcessAllEvents = -1 }; PROTOTYPE(void ProcessEvents, (EventProcessingType how, int howmany)) #endif