libsidplayfp  1.0.1
Public Member Functions | Protected Member Functions
EventScheduler Class Reference

#include <EventScheduler.h>

Inheritance diagram for EventScheduler:
EventContext

List of all members.

Public Member Functions

void reset ()
void clock ()
bool isPending (Event &event) const
event_clock_t getTime (event_phase_t phase) const
event_clock_t getTime (event_clock_t clock, event_phase_t phase) const
event_phase_t phase () const

Protected Member Functions

void schedule (Event &event, event_clock_t cycles, event_phase_t phase)
void schedule (Event &event, event_clock_t cycles)
void cancel (Event &event)

Detailed Description

Fast EventScheduler implementation

Author:
Antti S. Lankila

Member Function Documentation

void EventScheduler::cancel ( Event event)
protectedvirtual

Cancel the specified event.

Parameters:
eventthe event to cancel

Implements EventContext.

void EventScheduler::clock ( )
inline

Fire next event, advance system time to that event.

event_clock_t EventScheduler::getTime ( event_phase_t  phase) const
inlinevirtual

Get time with respect to a specific clock phase.

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

Implements EventContext.

event_clock_t EventScheduler::getTime ( event_clock_t  clock,
event_phase_t  phase 
) const
inlinevirtual

Get clocks since specified clock in given phase.

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

Implements EventContext.

bool EventScheduler::isPending ( Event event) const
virtual

Is the event pending in this scheduler?

Parameters:
eventthe event
Returns:
true when pending

Implements EventContext.

event_phase_t EventScheduler::phase ( ) const
inlinevirtual

Return current clock phase.

Returns:
The current phase

Implements EventContext.

void EventScheduler::reset ( )

Cancel all pending events and reset time.

void EventScheduler::schedule ( Event event,
event_clock_t  cycles,
event_phase_t  phase 
)
inlineprotectedvirtual

Add event to pending queue.

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

Parameters:
eventthe event to add
cycleshow many cycles from now to fire
phasethe phase when to fire the event

Implements EventContext.

void EventScheduler::schedule ( Event event,
event_clock_t  cycles 
)
inlineprotectedvirtual

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

Parameters:
eventthe event to add
cycleshow many cycles from now to fire

Implements EventContext.


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