Class | Description |
---|---|
Calendar |
Calendars are special event handlers derived from the abstract base class
Calendar . |
SimpleCalendar
,
are derived from the abstract base class Calendar
.
StdCalendar
uses a linear list for storing the events. For a high number of events within
the calendar this implementation gets slow. Therefore this class is only recommended for
models with few events or for test purposes.SimpleCalendar
a relatively complex but efficient procedure, especially for large
numbers of waiting events, is used to store event information.postEvent()
method must be called with a reference to the event (Event or one of
its derived classes), which generally is a data element of the model component (see ikr.simlib.model
) ,
and the time at which the event is expected to occur as parameters. Optionally, a priority
may be passed on. It is an integer and controls the order in which events are processed,
which are posted for the same time. Larger values are more important and cause events to
be executed primarily.cancelEvent()
method is called with a reference to the event as a parameter which
will cause the removal of the event.cancelEvent()
method on the event to be removed.ikr.simlib.control
) will call the function
processPendingEvents()
.processPendingEvents()
contains a loop, in which events can be successively processed.
This loop can be indirectly stopped by sequence control.getNextEvent()
from the class Calendar is called first,
which will remove the currently next event in the event list and return a pointer.processEvent()
(see Event
). Normally the responsibility is passed on to the responsible model component.cancelEvent()
, a particular post may be cancelled.