EventContext Class Reference

#include <event.h>

Inheritance diagram for EventContext:

EventScheduler

List of all members.

Public Member Functions

virtual void cancel (Event &event)=0
virtual void schedule (Event &event, event_clock_t cycles, event_phase_t phase)=0
virtual void schedule (Event &event, event_clock_t cycles)=0
virtual bool isPending (Event &event) const =0
virtual event_clock_t getTime (event_phase_t phase) const =0
virtual event_clock_t getTime (event_clock_t clock, event_phase_t phase) const =0
virtual event_phase_t phase () const =0


Detailed Description

Fast EventScheduler, which maintains a linked list of Events. This scheduler takes neglible time even when it is used to schedule events for nearly every clock.

Events occur on an internal clock which is 2x the visible clock. The visible clock is divided to two phases called phi1 and phi2.

The phi1 clocks are used by VIC and CIA chips, phi2 clocks by CPU.

Scheduling an event for a phi1 clock when system is in phi2 causes the event to be moved to the next phi1 cycle. Correspondingly, requesting a phi1 time when system is in phi2 returns the value of the next phi1.

Author:
Antti S. Lankila

Member Function Documentation

virtual void EventContext::cancel ( Event event  )  [pure virtual]

Cancel the specified event.

Parameters:
event the event to cancel

Implemented in EventScheduler.

virtual event_clock_t EventContext::getTime ( event_clock_t  clock,
event_phase_t  phase 
) const [pure virtual]

Get clocks since specified clock in given phase.

Parameters:
clock the time to compare to
phase the phase to comapre to
Returns:
the time between specified clock and now

Implemented in EventScheduler.

virtual event_clock_t EventContext::getTime ( event_phase_t  phase  )  const [pure virtual]

Get time with respect to a specific clock phase.

Parameters:
phase the phase
Returns:
the time according to specified phase.

Implemented in EventScheduler.

virtual bool EventContext::isPending ( Event event  )  const [pure virtual]

Is the event pending in this scheduler?

Parameters:
event the event
Returns:
true when pending

Implemented in EventScheduler.

virtual event_phase_t EventContext::phase (  )  const [pure virtual]

Return current clock phase.

Returns:
The current phase

Implemented in EventScheduler.

virtual void EventContext::schedule ( Event event,
event_clock_t  cycles 
) [pure virtual]

Add event to pending queue in the same phase as current event.

Parameters:
event the event to add
cycles how many cycles from now to fire

Implemented in EventScheduler.

virtual void EventContext::schedule ( Event event,
event_clock_t  cycles,
event_phase_t  phase 
) [pure virtual]

Add event to pending queue.

At PHI2, specify cycles=0 and Phase=PHI1 to fire on the very next PHI1.

Parameters:
event the event to add
cycles how many cycles from now to fire
phase the phase when to fire the event

Implemented in EventScheduler.


The documentation for this class was generated from the following file:

Generated on Sun Jul 14 23:12:59 2013 for libsidplayfp by  doxygen 1.5.9