libsidplayfp  1.8.7
Public Member Functions | Protected Member Functions | List of all members
EventScheduler Class Reference

#include <EventScheduler.h>

Inheritance diagram for EventScheduler:
EventContext

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, unsigned int cycles, event_phase_t phase)
 
void schedule (Event &event, unsigned int cycles)
 
void cancel (Event &event)
 

Detailed Description

Fast EventScheduler implementation

Author
Antti S. Lankila

Member Function Documentation

§ cancel()

void EventScheduler::cancel ( Event event)
protectedvirtual

Cancel the specified event.

Parameters
eventthe event to cancel

Implements EventContext.

§ clock()

void EventScheduler::clock ( )
inline

Fire next event, advance system time to that event.

§ getTime() [1/2]

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.

§ getTime() [2/2]

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.

§ isPending()

bool EventScheduler::isPending ( Event event) const
virtual

Check if an event is in the queue.

Implements EventContext.

§ phase()

event_phase_t EventScheduler::phase ( ) const
inlinevirtual

Return current clock phase.

Returns
The current phase

Implements EventContext.

§ reset()

void EventScheduler::reset ( )

Cancel all pending events and reset time.

§ schedule() [1/2]

void EventScheduler::schedule ( Event event,
unsigned int  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.

§ schedule() [2/2]

void EventScheduler::schedule ( Event event,
unsigned int  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: