OSDL::Engine::Scheduler Class Reference

#include <OSDLScheduler.h>

Collaboration diagram for OSDL::Engine::Scheduler:

[legend]
List of all members.

Detailed Description

This scheduler manages active objects so that they are in turn granted with the processing power they requested.

Two kinds of active objects can be scheduled :

Note:
For the application objects, the only relevant and useful unit for time with respect to scheduling is the simulation time, expressed in Events::SimulationTick. They should base their behaviour on this time, and only this time.
Rendering task is scheduled thanks to Events::RenderingTick, which allows to specify any frequency independently from logic frequency.

Whereas the scheduler internal time (EngineTick) is kept in synchronism with actual user time (in quasi-hard real time), the simulation and rendering times cannot ensure that deadlines are respected (because of many reasons, from the machine load to peak resource needs, OS scheduling and so on). Therefore they are only in soft real-time, and it is the job of the scheduler to manage that everything is done on time, on a best effort basis. Whenever a failure to meet a deadline occurs, the impacted objects are provided a means of being noticed, in order to be able to take any counter-measures they can.

The scheduler has two main data structures :

Our scheduler can follow two different behaviours :

Choosing a high logic frequency, and moreover higher than the rendering frequency, is the way to go, since it allows to get rid of interpolation and resampling issues. Clearly 33 Hz is the very least logic frequency one should use, and 100 Hz or higher frequencies should be preferred. Logic frequency should be multiple times higher than rendering frequency.

For the logic, please remember that the only time unit that should be used is the simulation tick. Do not try to depend on any real time measurement, since it would bypass the efforts of the scheduler to provide the application with a virtual fixed-rate logic time, and make it fail.

For the rendering, beware that some graphic primitives wait for vsync, which may freeze the process until the remaining part of the, say, 1/60th of second is reached. This hard real time practise would interfere badly with any scheduler. You can disable vsync, but one might experience more tearing and shearing. Conversely, the scheduler could take this behaviour into account and synchronize itself on the display refresh rate. It would have to manage a decrease in the frame rate if the scene complexity comes too close to have a rendering duration of the magic times (1/60 of second, 1/30 etc.) : because of random variations, some frames would go slightly over or under the time, leading to an irregular framerate which may be visually disturbing. Better switch to lower rendering rates and have a constant frame rate.

Rendering is obtained thanks to a renderer, if available, which is called at each rendering tick. If no renderer is being used, then the video module will be used, and requested to redraw at each rendering tick. The scheduled objects are in this case responsible for the updating of the screen surface.

add a means of knowing whether hardware synch with refresh rate is possible and, if so, use it not to schedule instead of the scheduler, but to make the scheduler start at the right time, so that it keeps naturally the synchronisation with the refresh rate. Or force the engine tick to be a hardware-locked frame pace.

Apart the logic and rendering frequencies, the scheduler have to handle the input frequency, which is the frequency at which input devices (such as keyboard, mouse, joysticks, etc.) are updated, according to pending low level events. One of the purposes of input handling is to have the controllers updated so that the simulation world is interactive. SDL input loop runs at 100 Hz, so higher frequencies would be useless.

Note:
With default settings, simulation frequency granularity should be less than + or -3 Hz on average.

The Scheduler is meant to be used as a singleton : having multiple scheduler instances on activity would be meaningless, and they would probably fail collectively.

The scheduler has been made so that no multithread paradigm is needed, but it could be useful one day to parallelize (if possible) at least the simulation evaluation, since there may be numerous active objects that could take advantage of hyperthreading, dual cores etc.

For the simulation step, there could be too a two-pass algorithm : first compute, but do not apply, all the newer states of all objects, then, second pass, apply them. The problem is indeed that an object whose state depends on the state of other objects should take them into account at time t, when computing state at t+1, in their state at t, and not t+1. If all objects were to be updated in a single row, the first ones would be already at t+1 while the remaining would have to be updated from t to t+1. As among the remaining objects some may depend on the first ones, they would take into account t+1 states and not t states. Moreover, as there may be cyclic dependencies (say, for collisions, where two objects became mutually dependent), no right order can be found. Therefore a two-pass algorithm may be helpful.

Note:
Some breathing time (letting the operating system schedule other processes) would be probably necessary, since for example the Linux kernel seems to take control away for a rather long while when it detects a program running at 100%. However it would involve waiting regularly for 1ms (kernel 2.6) or 10ms (kernel 2.4), and many skips would occur.

The scheduler can run continuously for up to 48 days : after, engine ticks will overflow and it will lead to a scheduler shutdown.

Definition at line 217 of file OSDLScheduler.h.

Public Member Functions

virtual bool hasRenderer () const throw ()
 Tells whether a renderer is available to this scheduler.
virtual Rendering::RenderergetRenderer () const throw ( SchedulingException )
 Returns currently used renderer, if any.
virtual void setRenderer (Rendering::Renderer &newRenderer) throw ()
 Assigns a new renderer, which will be called on every rendering tick, either to actually render, or to be notified of a rendering skip.
virtual void setScreenshotMode (bool on, const std::string &frameFilenamePrefix, Events::Hertz frameFrequency=25) throw ()
 Tells whether the application should run interactively, in real time (if on is false), or if it should run in record mode, with a virtual fixed framerate (as specified as frameFrequency), with logic and rendering taking all the time they need.
virtual void setTimeSliceDuration (Ceylan::System::Microsecond engineTickDuration) throw ()
 Defines how many microseconds an engine tick should last, and updates accordingly the simulation and rendering ticks.
virtual Ceylan::System::Microsecond getTimeSliceDuration () const throw ()
 Returns the current time slice duration, as used by this scheduler.
virtual void setSimulationFrequency (Events::Hertz frequency) throw ( SchedulingException )
 Sets the simulation frequency, by evaluating the number of engine ticks to be associated to one simulation tick for frequency to be met.
virtual Events::Period getSimulationTickCount () const throw ()
 Returns the number of engine ticks which correspond to one simulation tick.
virtual void setRenderingFrequency (Events::Hertz frequency) throw ( SchedulingException )
 Sets the rendering frequency, by evaluating the number of engine ticks to be associated to one rendering tick.
virtual Events::Period getRenderingTickCount () const throw ()
 Returns the number of engine ticks which correspond to one rendering tick.
virtual void setScreenshotFrequency (Events::Hertz frequency) throw ( SchedulingException )
 Sets the screenshot frequency, by evaluating the number of engine ticks to be associated to one screenshot tick for frequency to be met.
virtual Events::Period getScreenshotTickCount () const throw ()
 Returns the number of engine ticks which correspond to one screenshot tick.
virtual void setInputPollingFrequency (Events::Hertz frequency) throw ( SchedulingException )
 Sets the input polling frequency, by evaluating the number of engine ticks to be associated to one input tick.
virtual Events::Period getInputPollingTickCount () const throw ()
 Returns the number of engine ticks which correspond to one input tick.
virtual void setIdleCallback (Ceylan::System::Callback idleCallback=0, void *callbackData=0, Ceylan::System::Microsecond callbackExpectedMaxDuration=0) throw ()
 Sets the idle function, which is called whenever the scheduler detects a period of idle activity.
virtual Events::EngineTick getCurrentEngineTick () const throw ()
 Returns the current actual engine tick.
virtual Events::SimulationTick getCurrentSimulationTick () const throw ()
 Returns the current actual simulation tick.
virtual Events::RenderingTick getCurrentRenderingTick () const throw ()
 Returns the current actual rendering tick.
virtual Events::RenderingTick getCurrentInputTick () const throw ()
 Returns the current actual input tick.
virtual void registerObject (ActiveObject &toRegister) throw ()
 Registers specified active object in scheduling slots.
virtual void schedule () throw ( SchedulingException )
 Launches the schedule loop, which behaves as a specialized never-ending event loop.
virtual void stop () throw ()
 Requests the scheduler to stop its activities at the end of current engine tick.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.

Static Public Member Functions

static SchedulerGetExistingScheduler () throw ( SchedulingException )
 Returns the one and only one scheduler instance, that should be already available.
static SchedulerGetScheduler () throw ()
 Returns the one and only scheduler instance.
static void DeleteExistingScheduler () throw ( SchedulingException )
 Deletes the existing shared scheduler.
static void DeleteScheduler () throw ()
 Deletes the shared scheduler, if any.

Static Public Attributes

static const Ceylan::System::Microsecond DefaultEngineTickDuration = 1000
 Determines the default engine tick duration.
static const Events::Hertz DefaultSimulationFrequency = 100
 Determines the default frequency for logic (simulation).
static const Events::Hertz DefaultRenderingFrequency = 40
 Determines the default frequency for rendering.
static const Ceylan::Uint32 DefaultMovieFrameFrequency = 25
 By default, generated screenshots will be saved on the purpose of being gathered by a movie with 25 images per second.
static const Events::Hertz DefaultInputFrequency = 20
 Determines the default frequency for rendering.

Protected Member Functions

 Scheduler () throw ()
 Constructs a new scheduler.
virtual ~Scheduler () throw ()
 Virtual destructor, any existing renderer is deleted whereas no active object is destroyed.
virtual void scheduleBestEffort () throw ( SchedulingException )
 Actual scheduling method used for real-time and/or interactive applications.
virtual void scheduleNoDeadline (bool pollInputs=true) throw ( SchedulingException )
 Actual scheduling method used for batch applications, which do not care about keeping any user-defined pace.
virtual Events::EngineTick computeEngineTickFromCurrentTime () throw ()
 Returns the value that should be the engine tick, if no scheduling skip had happened.
virtual void scheduleSimulation (Events::SimulationTick current) throw ()
 Takes care of the simulation by making live relevant active objects, when a simulation step is reached.
virtual void scheduleProgrammedObjects (Events::SimulationTick current) throw ()
 Takes care of the simulation of programmed objects, by activating the relevant ones.
virtual void schedulePeriodicObjects (Events::SimulationTick currentSimulationTick) throw ()
 Takes care of the simulation of periodic objects, by activating the relevant ones.
virtual void scheduleRendering (Events::RenderingTick currentRenderingTick) throw ()
 Triggers the rendering.
virtual void scheduleInput (Events::InputTick currentInputTick) throw ()
 Triggers the input update.
virtual void scheduleActiveObjectList (Events::RenderingTick currentSimulationTick, ListOfActiveObjects &objectList) throw ()
 Helper method to schedule (execute) in turn every active object of the list.
virtual void onSimulationSkipped (Events::SimulationTick skipped) throw ( SchedulingException )
 Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified simulation step, which will have therefore to be skipped.
virtual void onRenderingSkipped (Events::RenderingTick skipped) throw ( SchedulingException )
 Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified rendering step, which will have therefore to be skipped.
virtual void onInputSkipped (Events::InputTick skipped) throw ( SchedulingException )
 Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified input step, which will have therefore to be skipped.
virtual void onIdle () throw ()
 Called whenever the application is deemed idle.
virtual void onScheduleFailure (Delay currentBucket) throw ()
 Called whenever the scheduler does not succeed in keeping up the pace with what the application demanded : if the runtime resources are not high enough, then the scheduler may fail regularly and progressively fill up its delay bucket.
virtual void programTriggerFor (ActiveObject &objectToProgram, Events::SimulationTick targetTick) throw ()
 Adds a programmed activation for objectToProgram at simulation tick targetTick.
virtual PeriodicSlotgetPeriodicSlotFor (Events::Period period) throw ()
 Returns the internal periodic slot for specified period.

Protected Attributes

bool _screenshotMode
 Tells whether screenshot mode is activated (default : deactivated).
std::string _frameFilenamePrefix
 Records which prefix should be used to name numbered screenshot files.
Events::Hertz _desiredScreenshotFrequency
 Records the user-defined screenshot frequency, which is the targeted number of frames per second.
Events::Period _screenshotPeriod
 Stores the period corresponding to the planned framerate for the movie that would be generated, if screenshot mode is activated.
std::list< PeriodicSlot * > _periodicSlots
 A list containing all available periodic slots, sorted by increasing periods.
std::map< Events::SimulationTick,
ListOfActiveObjects
_programmedActivated
 Map for programmed activations.
Ceylan::System::Microsecond _engineTickDuration
 Defines the duration in microseconds of an elementary scheduler tick.
Ceylan::Uint32 _secondToEngineTick
 Multiplicative factor that allows to convert seconds into engine ticks.
Events::EngineTick _currentEngineTick
 Records the current engine tick.
Events::SimulationTick _currentSimulationTick
 Records the current simulation tick.
Events::RenderingTick _currentRenderingTick
 Records the current rendering tick.
Events::RenderingTick _currentInputTick
 Records the current input tick.
Events::Period _simulationPeriod
 Duration between two successive simulation steps, expressed in engine ticks.
Events::Period _renderingPeriod
 Duration between two successive rendering steps, expressed in engine ticks.
Events::Period _inputPeriod
 Duration between two successive input steps, expressed in engine ticks.
Events::Hertz _desiredSimulationFrequency
 Records the user-defined simulation frequency.
Events::Hertz _desiredRenderingFrequency
 Records the user-defined rendering frequency.
Events::Hertz _desiredInputFrequency
 Records the user-defined input frequency.
Ceylan::System::Callback _idleCallback
 The idle callback, if any, to be called by the scheduler.
void * _idleCallbackData
 The data, if any, to provide to the idle callback.
Ceylan::System::Microsecond _idleCallbackMaxDuration
 An estimated upper bound of the duration of current idle callback.
Ceylan::Uint32 _idleCallsCount
 Count the number of idle calls made during the current scheduler session.
bool _stopRequested
 Tells whether the scheduler has been requested to stop.
Ceylan::System::Second _scheduleStartingSecond
 Stores the second when scheduling started.
Ceylan::System::Microsecond _scheduleStartingMicrosecond
 Stores the microsecond when scheduling started.
Ceylan::Uint32 _recoveredSimulationTicks
 Records how many simulation ticks were recovered since the scheduler was started.
Ceylan::Uint32 _missedSimulationTicks
 Records how many simulation ticks were missed since the scheduler was started.
Ceylan::Uint32 _recoveredRenderingTicks
 Records how many rendering ticks were recovered since the scheduler was started.
Ceylan::Uint32 _missedRenderingTicks
 Records how many rendering ticks were missed since the scheduler was started.
Ceylan::Uint32 _recoveredInputPollingTicks
 Records how many input ticks were recovered since the scheduler was started.
Ceylan::Uint32 _missedInputPollingTicks
 Records how many input ticks were missed since the scheduler was started.
Ceylan::Uint32 _scheduleFailureCount
 Records how many schedule failures were reported.
Events::EventsModule_eventsModule
 References the events module, if necessary.
Rendering::Renderer_renderer
 References the renderer to be used, if any.
Video::VideoModule_videoModule
 References the video module, if necessary.

Static Protected Attributes

static const Delay ShutdownBucketLevel
 Threshold for the level of delay bucket, above which the scheduler will be stopped automatically.

Private Types

typedef Ceylan::Uint32 Delay
 Used to measure time past deadlines.

Private Member Functions

 Scheduler (const Scheduler &source) throw ()
 Copy constructor made private to ensure that it will never be called.
Scheduleroperator= (const Scheduler &source) throw ()
 Assignment operator made private to ensure that it will never be called.

Static Private Attributes

static Scheduler_internalScheduler
 The internal single instance of scheduler, if any.


Member Typedef Documentation

typedef Ceylan::Uint32 OSDL::Engine::Scheduler::Delay [private]

Used to measure time past deadlines.

Definition at line 222 of file OSDLScheduler.h.


Constructor & Destructor Documentation

Scheduler::Scheduler (  )  throw () [explicit, protected]

Constructs a new scheduler.

Note:
Protected to ensure the singleton pattern is respected.

Definition at line 768 of file OSDLScheduler.cc.

References DefaultEngineTickDuration, setTimeSliceDuration(), and OSDL::Video::Pixels::toString().

Referenced by GetScheduler().

Scheduler::~Scheduler (  )  throw () [protected, virtual]

Virtual destructor, any existing renderer is deleted whereas no active object is destroyed.

Note:
Protected to ensure the singleton pattern is respected.

Definition at line 818 of file OSDLScheduler.cc.

References _periodicSlots, and _renderer.

OSDL::Engine::Scheduler::Scheduler ( const Scheduler source  )  throw () [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

bool Scheduler::hasRenderer (  )  const throw () [virtual]

Tells whether a renderer is available to this scheduler.

If no renderer is registered, the video module will be used instead.

Definition at line 54 of file OSDLScheduler.cc.

References _renderer.

Renderer & Scheduler::getRenderer (  )  const throw ( SchedulingException ) [virtual]

Returns currently used renderer, if any.

Exceptions:
SchedulingException if no renderer is available.

Definition at line 62 of file OSDLScheduler.cc.

References _renderer.

void Scheduler::setRenderer ( Rendering::Renderer newRenderer  )  throw () [virtual]

Assigns a new renderer, which will be called on every rendering tick, either to actually render, or to be notified of a rendering skip.

Parameters:
newRenderer the renderer to be used from now.
Note:
Will delete any previously existing renderer, and will take ownership of the specified renderer.

Definition at line 74 of file OSDLScheduler.cc.

virtual void OSDL::Engine::Scheduler::setScreenshotMode ( bool  on,
const std::string &  frameFilenamePrefix,
Events::Hertz  frameFrequency = 25 
) throw () [virtual]

Tells whether the application should run interactively, in real time (if on is false), or if it should run in record mode, with a virtual fixed framerate (as specified as frameFrequency), with logic and rendering taking all the time they need.

In this mode, even if the logic and the rendering tasks last for two hours for each virtual second, the resulting set of PNG files is made so that these files can be gathered to form an animation with, for instance, 25 frames per second. When this animation will be played, the logic will seem to have acted with respect to the planned framerate, as if in real time.

Parameters:
on tells whether frames are to be rendered to file (iff on), or if the application should run interactively.
frameFilenamePrefix determines which prefix will be used to name successive screenshots, in the form : 'frameFilenamePrefix'-n.png, n being the frame count of the animation.
frameFrequency tells how many frames should be rendered each second. At least 25 frames per second is recommended to be able to realize smooth animations.
See also:
OSDL user's guide to know how simply create a MPEG video out of the set of image files that is produced in screenshot mode.

virtual void OSDL::Engine::Scheduler::setTimeSliceDuration ( Ceylan::System::Microsecond  engineTickDuration  )  throw () [virtual]

Defines how many microseconds an engine tick should last, and updates accordingly the simulation and rendering ticks.

For example, an engine tick duration of 1000 microseconds defines a scheduling frequency of 1 kHz (1000 Hz). Then all scheduled events should then have a periodicity of at most 1000 Hz, probably far lower.

Parameters:
engineTickDuration the period of time between two scheduler elementary ticks, expressed in microseconds.
Note:
When changing this setting, in most cases the scheduled objects are to be changed or updated.
See also:
DefaultEngineTickDuration

Referenced by Scheduler().

Microsecond Scheduler::getTimeSliceDuration (  )  const throw () [virtual]

Returns the current time slice duration, as used by this scheduler.

Note:
Average settings would be 1000 microseconds = 1 millisecond for each engine tick.

Definition at line 116 of file OSDLScheduler.cc.

References _engineTickDuration.

Referenced by OSDL::Engine::ActiveObject::setFrequency().

void Scheduler::setSimulationFrequency ( Events::Hertz  frequency  )  throw ( SchedulingException ) [virtual]

Sets the simulation frequency, by evaluating the number of engine ticks to be associated to one simulation tick for frequency to be met.

Exceptions:
SchedulingException if requested frequency is superior to engine frequency.
See also:
DefaultSimulationFrequency

Definition at line 124 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Period Scheduler::getSimulationTickCount (  )  const throw () [virtual]

Returns the number of engine ticks which correspond to one simulation tick.

Note:
It allows to take into account the round-off that had to be performed by the setSimulationFrequency method.

Definition at line 162 of file OSDLScheduler.cc.

References _simulationPeriod.

Referenced by OSDL::Engine::ActiveObject::setFrequency().

void Scheduler::setRenderingFrequency ( Events::Hertz  frequency  )  throw ( SchedulingException ) [virtual]

Sets the rendering frequency, by evaluating the number of engine ticks to be associated to one rendering tick.

Exceptions:
SchedulingException if requested frequency is superior to engine frequency.
See also:
DefaultRenderingFrequency

Definition at line 170 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Period Scheduler::getRenderingTickCount (  )  const throw () [virtual]

Returns the number of engine ticks which correspond to one rendering tick.

Note:
It allows to take into account the round-off that had to be performed by the setRenderingFrequency method.

Definition at line 209 of file OSDLScheduler.cc.

References _renderingPeriod.

void Scheduler::setScreenshotFrequency ( Events::Hertz  frequency  )  throw ( SchedulingException ) [virtual]

Sets the screenshot frequency, by evaluating the number of engine ticks to be associated to one screenshot tick for frequency to be met.

Exceptions:
SchedulingException if requested frequency is superior to engine frequency.
See also:
DefaultSimulationFrequency

Definition at line 217 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Period Scheduler::getScreenshotTickCount (  )  const throw () [virtual]

Returns the number of engine ticks which correspond to one screenshot tick.

Note:
It allows to take into account the round-off that had to be performed by the setScreenshotFrequency method.

Definition at line 260 of file OSDLScheduler.cc.

References _screenshotPeriod.

void Scheduler::setInputPollingFrequency ( Events::Hertz  frequency  )  throw ( SchedulingException ) [virtual]

Sets the input polling frequency, by evaluating the number of engine ticks to be associated to one input tick.

Exceptions:
SchedulingException if requested frequency is superior to engine frequency.
See also:
DefaultInputFrequency

Definition at line 268 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Period Scheduler::getInputPollingTickCount (  )  const throw () [virtual]

Returns the number of engine ticks which correspond to one input tick.

Note:
It allows to take into account the round-off that had to be performed by the setInputPollingFrequency method.

Definition at line 325 of file OSDLScheduler.cc.

References _inputPeriod.

void Scheduler::setIdleCallback ( Ceylan::System::Callback  idleCallback = 0,
void *  callbackData = 0,
Ceylan::System::Microsecond  callbackExpectedMaxDuration = 0 
) throw () [virtual]

Sets the idle function, which is called whenever the scheduler detects a period of idle activity.

The callback can be useful for example to let the process yield some CPU time so that the OS does not consider it as too CPU-hungry, and does not take counter-measures against it.

Note:
Ensure that the maximum time spent in the idle callback is negligible compared to the period corresponding to the maximum engine frequency being set, so that it does not result in a too heavy load which would make the scheduler fail constantly because of its idle function.
Parameters:
idleCallback the idle callback, which can be null (0) to specify no idle callback is wanted.
callbackData the user-supplied data pointer that the idle callback will be given, if not null.
callbackExpectedMaxDuration the maximum duration, in microseconds, expected for this idle call-back. Helps the scheduler enforcing its target frequency. If this value is null, the idle callback will be launched once immediately (during the call of this method), and the measured duration, increased of 20%, will be kept as upper bound.
Any prior callback or callback data will be replaced by the one specified.

Definition at line 306 of file OSDLScheduler.cc.

EngineTick Scheduler::getCurrentEngineTick (  )  const throw () [virtual]

Returns the current actual engine tick.

Definition at line 333 of file OSDLScheduler.cc.

References _currentEngineTick.

SimulationTick Scheduler::getCurrentSimulationTick (  )  const throw () [virtual]

Returns the current actual simulation tick.

Definition at line 341 of file OSDLScheduler.cc.

References _currentSimulationTick.

RenderingTick Scheduler::getCurrentRenderingTick (  )  const throw () [virtual]

Returns the current actual rendering tick.

Definition at line 349 of file OSDLScheduler.cc.

References _currentRenderingTick.

RenderingTick Scheduler::getCurrentInputTick (  )  const throw () [virtual]

Returns the current actual input tick.

Definition at line 357 of file OSDLScheduler.cc.

References _currentInputTick.

void Scheduler::registerObject ( ActiveObject toRegister  )  throw () [virtual]

Registers specified active object in scheduling slots.

Depending on the object defining or not a periodic and/or programmed activations, the scheduler will store these informations in order to be able to activate periodically and/or at specific simulation ticks this object.

Parameters:
toRegister the active object to register to the scheduler.
Todo:
Maybe add an optional time offset so that the life of registered object can start later (the object can however emulate easily this behaviour), even if periodic.

Definition at line 365 of file OSDLScheduler.cc.

void Scheduler::schedule (  )  throw ( SchedulingException ) [virtual]

Launches the schedule loop, which behaves as a specialized never-ending event loop.

Exceptions:
SchedulingException,when propagated from active objects having problems.

Definition at line 409 of file OSDLScheduler.cc.

References _eventsModule, _renderer, _screenshotMode, _videoModule, OSDL::CommonModule::getEventsModule(), OSDL::getExistingCommonModule(), OSDL::CommonModule::getVideoModule(), scheduleBestEffort(), scheduleNoDeadline(), and OSDL::Rendering::Renderer::toString().

void Scheduler::stop (  )  throw () [virtual]

Requests the scheduler to stop its activities at the end of current engine tick.

Definition at line 455 of file OSDLScheduler.cc.

References _stopRequested.

const string Scheduler::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Definition at line 463 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Referenced by scheduleBestEffort().

Scheduler & Scheduler::GetExistingScheduler (  )  throw ( SchedulingException ) [static]

Returns the one and only one scheduler instance, that should be already available.

The returned value is a reference and not a pointer, to avoid any abnormal deallocation by its users, that should never deallocate the scheduler.

Exceptions:
SchedulingException if there is no scheduler available.

Definition at line 681 of file OSDLScheduler.cc.

References _internalScheduler.

Referenced by OSDL::Engine::ActiveObject::setFrequency().

Scheduler & Scheduler::GetScheduler (  )  throw () [static]

Returns the one and only scheduler instance.

If no scheduler was already available, a new singletoned instance is created.

The returned value is a reference and not a pointer, to avoid any abnormal deallocation by its users, that should never deallocate the scheduler.

Definition at line 693 of file OSDLScheduler.cc.

References _internalScheduler, Scheduler(), and OSDL::Video::Pixels::toString().

void Scheduler::DeleteExistingScheduler (  )  throw ( SchedulingException ) [static]

Deletes the existing shared scheduler.

Exceptions:
SchedulingException if not scheduler was available.

Definition at line 720 of file OSDLScheduler.cc.

References _internalScheduler.

void Scheduler::DeleteScheduler (  )  throw () [static]

Deletes the shared scheduler, if any.

Definition at line 738 of file OSDLScheduler.cc.

References _internalScheduler.

void Scheduler::scheduleBestEffort (  )  throw ( SchedulingException ) [protected, virtual]

Actual scheduling method used for real-time and/or interactive applications.

Note:
Best efforts means that if deadlines cannot be met, some simulation or rendering steps might be skipped.

Definition at line 833 of file OSDLScheduler.cc.

References _currentEngineTick, _currentInputTick, _currentRenderingTick, _currentSimulationTick, _desiredInputFrequency, _desiredRenderingFrequency, _desiredSimulationFrequency, _engineTickDuration, _idleCallback, _idleCallbackMaxDuration, _idleCallsCount, _inputPeriod, _missedInputPollingTicks, _missedRenderingTicks, _missedSimulationTicks, _recoveredInputPollingTicks, _recoveredRenderingTicks, _recoveredSimulationTicks, _renderingPeriod, _scheduleFailureCount, _scheduleStartingMicrosecond, _scheduleStartingSecond, _simulationPeriod, _stopRequested, computeEngineTickFromCurrentTime(), DefaultEngineTickDuration, onIdle(), onInputSkipped(), onRenderingSkipped(), onScheduleFailure(), onSimulationSkipped(), OSDL_SCHEDULE_LOG, scheduleInput(), scheduleRendering(), scheduleSimulation(), ShutdownBucketLevel, OSDL::Video::Pixels::toString(), and toString().

Referenced by schedule().

void Scheduler::scheduleNoDeadline ( bool  pollInputs = true  )  throw ( SchedulingException ) [protected, virtual]

Actual scheduling method used for batch applications, which do not care about keeping any user-defined pace.

Parameters:
pollInputs tells whether inputs should be polled nevertheless.
Note:
The program takes all the time it needs to perform its tasks, so that no simulation nor rendering step is skipped, even if the whole processing takes significantly longer. Useful to generate screenshots.

Definition at line 2185 of file OSDLScheduler.cc.

References OSDL_SCHEDULE_LOG, and OSDL::Video::Pixels::toString().

Referenced by schedule().

EngineTick Scheduler::computeEngineTickFromCurrentTime (  )  throw () [protected, virtual]

Returns the value that should be the engine tick, if no scheduling skip had happened.

This engine tick is computed from the current time since the beginning of scheduling, which is obtained thanks to a call to a precise actual time measurement minus the offset corresponding to the starting time of the scheduling.

See also:
Ceylan::getPreciseTime, _scheduleStartingSecond, _scheduleStartingMicrosecond

Definition at line 2506 of file OSDLScheduler.cc.

References _engineTickDuration, _scheduleStartingMicrosecond, _scheduleStartingSecond, _secondToEngineTick, and _stopRequested.

Referenced by scheduleBestEffort().

void Scheduler::scheduleSimulation ( Events::SimulationTick  current  )  throw () [protected, virtual]

Takes care of the simulation by making live relevant active objects, when a simulation step is reached.

Parameters:
current the simulation tick to perform, for objects to be able to behave appropriatly, for example for first behaviour approach (stateless objects).

Definition at line 2560 of file OSDLScheduler.cc.

References OSDL_SCHEDULE_LOG.

Referenced by scheduleBestEffort().

void Scheduler::scheduleProgrammedObjects ( Events::SimulationTick  current  )  throw () [protected, virtual]

Takes care of the simulation of programmed objects, by activating the relevant ones.

Parameters:
current the simulation tick to perform, for programmed objects to know to which programmed step this activation corresponds.

Definition at line 2576 of file OSDLScheduler.cc.

void Scheduler::schedulePeriodicObjects ( Events::SimulationTick  currentSimulationTick  )  throw () [protected, virtual]

Takes care of the simulation of periodic objects, by activating the relevant ones.

Parameters:
currentSimulationTick the simulation tick to perform, for objects to be able to behave appropriately, for example for first behaviour approach (stateless objects).

Definition at line 2596 of file OSDLScheduler.cc.

void Scheduler::scheduleRendering ( Events::RenderingTick  currentRenderingTick  )  throw () [protected, virtual]

Triggers the rendering.

Parameters:
currentRenderingTick the current rendering tick.

Definition at line 2610 of file OSDLScheduler.cc.

References OSDL_SCHEDULE_LOG.

Referenced by scheduleBestEffort().

void Scheduler::scheduleInput ( Events::InputTick  currentInputTick  )  throw () [protected, virtual]

Triggers the input update.

Parameters:
currentInputTick the current input tick.

Definition at line 2631 of file OSDLScheduler.cc.

References OSDL_SCHEDULE_LOG.

Referenced by scheduleBestEffort().

void Scheduler::scheduleActiveObjectList ( Events::RenderingTick  currentSimulationTick,
ListOfActiveObjects objectList 
) throw () [protected, virtual]

Helper method to schedule (execute) in turn every active object of the list.

Parameters:
currentSimulationTick the simulation tick to be passed to the activated objects.
objectList the list of the active objects to execute in turn.

Definition at line 2647 of file OSDLScheduler.cc.

void Scheduler::onSimulationSkipped ( Events::SimulationTick  skipped  )  throw ( SchedulingException ) [protected, virtual]

Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified simulation step, which will have therefore to be skipped.

By default, this method calls on all active objects whose simulation step has been skipped their onSkip method.

Note:
If an object is registered multiple times for a given skipped simulation tick (ex : multiple periodic and/or programmed activations), then its onSkip method will be called as many times as it should have been activated.

Skipping methods should be, on average, faster than their normally scheduled counterparts (onNextTick), otherwise the scheduler will have no chance of keeping up with the real time.

Definition at line 2661 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Referenced by scheduleBestEffort().

void Scheduler::onRenderingSkipped ( Events::RenderingTick  skipped  )  throw ( SchedulingException ) [protected, virtual]

Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified rendering step, which will have therefore to be skipped.

By default, this method does nothing except complaining in the warning channel.

Note:
Skipping methods should be, on average, faster than their normally scheduled counterparts, otherwise the scheduler will have no chance of keeping up with the real time.

Definition at line 2706 of file OSDLScheduler.cc.

References OSDL::Video::Pixels::toString().

Referenced by scheduleBestEffort().

void Scheduler::onInputSkipped ( Events::InputTick  skipped  )  throw ( SchedulingException ) [protected, virtual]

Overridable method called when this scheduler detects that processing power was not high enough to perform on time specified input step, which will have therefore to be skipped.

By default, this method does nothing at all. As only the freshest inputs are generally useful, most applications will leave this method as a do-nothing one.

Note:
Skipping methods should be, on average, faster than their normally scheduled counterparts, otherwise the scheduler will have no chance of keeping up with the real time.

Definition at line 2723 of file OSDLScheduler.cc.

Referenced by scheduleBestEffort().

void Scheduler::onIdle (  )  throw () [protected, virtual]

Called whenever the application is deemed idle.

Applies the idle behaviour, which can be user-defined (setIdleCallback), or otherwise which will default to micro-sleeps.

See also:
setIdleCallback.

Definition at line 2734 of file OSDLScheduler.cc.

References _idleCallback, _idleCallbackData, _idleCallsCount, and OSDL_SCHEDULE_LOG.

Referenced by scheduleBestEffort().

void Scheduler::onScheduleFailure ( Delay  currentBucket  )  throw () [protected, virtual]

Called whenever the scheduler does not succeed in keeping up the pace with what the application demanded : if the runtime resources are not high enough, then the scheduler may fail regularly and progressively fill up its delay bucket.

In this case this method - made to be overloaded - is called with the current bucket value. It can then take countermeasures (preferably without taking too much time, otherwise it will be responsible for the scheduling failure).

The default implementation will send notifications in the error log channel if below ShutdownBucketLevel, and will stop the scheduler if higher.

See also:
ShutdownBucketLevel

Definition at line 2763 of file OSDLScheduler.cc.

References OSDL_SCHEDULE_LOG, OSDL::stop(), and OSDL::Video::Pixels::toString().

Referenced by scheduleBestEffort().

void Scheduler::programTriggerFor ( ActiveObject objectToProgram,
Events::SimulationTick  targetTick 
) throw () [protected, virtual]

Adds a programmed activation for objectToProgram at simulation tick targetTick.

Parameters:
objectToProgram the object whose activation is being programmed.
targetTick the simulation tick when specified object should be activated.

Definition at line 2808 of file OSDLScheduler.cc.

PeriodicSlot & Scheduler::getPeriodicSlotFor ( Events::Period  period  )  throw () [protected, virtual]

Returns the internal periodic slot for specified period.

If there is no slot for this period, a new slot is created and returned.

Definition at line 2837 of file OSDLScheduler.cc.

Scheduler& OSDL::Engine::Scheduler::operator= ( const Scheduler source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.


Member Data Documentation

const Ceylan::System::Microsecond OSDL::Engine::Scheduler::DefaultEngineTickDuration = 1000 [static]

Determines the default engine tick duration.

Note:
A value of 1000 implies a one millisecond scheduling, corresponding to a scheduling frequency of 1 kHz. Most interactive applications should be satisfied with this setting.

Definition at line 631 of file OSDLScheduler.h.

Referenced by scheduleBestEffort(), and Scheduler().

const Events::Hertz OSDL::Engine::Scheduler::DefaultSimulationFrequency = 100 [static]

Determines the default frequency for logic (simulation).

Note:
A value of 100 Hz implies a 10 ms scheduling.

Definition at line 640 of file OSDLScheduler.h.

const Events::Hertz OSDL::Engine::Scheduler::DefaultRenderingFrequency = 40 [static]

Determines the default frequency for rendering.

Note:
A value of 40 Hz (40 frames per second) implies a 25 ms scheduling.

Definition at line 650 of file OSDLScheduler.h.

const Ceylan::Uint32 OSDL::Engine::Scheduler::DefaultMovieFrameFrequency = 25 [static]

By default, generated screenshots will be saved on the purpose of being gathered by a movie with 25 images per second.

See also:
OSDL users'guide to know how to generate such a movie.

Definition at line 661 of file OSDLScheduler.h.

const Events::Hertz OSDL::Engine::Scheduler::DefaultInputFrequency = 20 [static]

Determines the default frequency for rendering.

Note:
A value of 20 Hz (20 input polling per second) implies a 50 ms scheduling.

Definition at line 671 of file OSDLScheduler.h.

const Scheduler::Delay Scheduler::ShutdownBucketLevel [static, protected]

Threshold for the level of delay bucket, above which the scheduler will be stopped automatically.

Definition at line 903 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

bool OSDL::Engine::Scheduler::_screenshotMode [protected]

Tells whether screenshot mode is activated (default : deactivated).

Note:
Screenshot mode is also known as 'no deadline' mode, as opposed to 'best effort' mode, which is in soft real time.

Definition at line 968 of file OSDLScheduler.h.

Referenced by schedule().

std::string OSDL::Engine::Scheduler::_frameFilenamePrefix [protected]

Records which prefix should be used to name numbered screenshot files.

The purpose of these files is mainly to be gathered in a movie (ex : MPEG).

Definition at line 979 of file OSDLScheduler.h.

Events::Hertz OSDL::Engine::Scheduler::_desiredScreenshotFrequency [protected]

Records the user-defined screenshot frequency, which is the targeted number of frames per second.

Useful if the corresponding period had to be computed again after the engine tick duration changed.

Definition at line 990 of file OSDLScheduler.h.

Events::Period OSDL::Engine::Scheduler::_screenshotPeriod [protected]

Stores the period corresponding to the planned framerate for the movie that would be generated, if screenshot mode is activated.

Movie periods, which are the duration between two successive screenshots, are expressed in engine ticks.

Definition at line 1002 of file OSDLScheduler.h.

Referenced by getScreenshotTickCount().

std::list<PeriodicSlot *> OSDL::Engine::Scheduler::_periodicSlots [protected]

A list containing all available periodic slots, sorted by increasing periods.

Note:
This is a list of pointers and not of PeriodicSlot instances since adding a new slot would otherwise result in a call to a copy constructor we do not want to define.

Definition at line 1025 of file OSDLScheduler.h.

Referenced by ~Scheduler().

std::map<Events::SimulationTick, ListOfActiveObjects> OSDL::Engine::Scheduler::_programmedActivated [protected]

Map for programmed activations.

Each key of the map is a specific simulation tick, whereas its value is a list of all objects having requested to be scheduled at this particular simulation tick.

A map (namely, a hash table) has been prefered to a list sorted in chronological order, since with a map, even if reading whether there are programmed triggers next simulation steps is slower (0(log n) instead of 0(1)), insertion times are much faster, (0(n.log n) instead of 0(n)).

As there may be numerous programmed triggers (ex : for playing sound delayed by distance), the map might be helpful here.

Definition at line 1049 of file OSDLScheduler.h.

Ceylan::System::Microsecond OSDL::Engine::Scheduler::_engineTickDuration [protected]

Defines the duration in microseconds of an elementary scheduler tick.

Definition at line 1059 of file OSDLScheduler.h.

Referenced by computeEngineTickFromCurrentTime(), getTimeSliceDuration(), and scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_secondToEngineTick [protected]

Multiplicative factor that allows to convert seconds into engine ticks.

Note:
Useful to avoid overflow with conversions.

Definition at line 1069 of file OSDLScheduler.h.

Referenced by computeEngineTickFromCurrentTime().

Events::EngineTick OSDL::Engine::Scheduler::_currentEngineTick [protected]

Records the current engine tick.

Useful to determine how much time have elapsed since last schedule action.

Note:
Under normal circumstances (not too heavy load), the current engine tick multiplied by the engine tick duration should correspond to the current user time, with the offset of the library initialization time t0 : (current time) - t0 = ( current engine tick ) * ( engine tick duration )
The scheduler has for purpose to enforce this property, but insufficient processing resources can make the engine time drift : hence one should not rely on this property being verified.

Therefore, this data member is the only one that is authoritative (the only actual value).

Definition at line 1094 of file OSDLScheduler.h.

Referenced by getCurrentEngineTick(), and scheduleBestEffort().

Events::SimulationTick OSDL::Engine::Scheduler::_currentSimulationTick [protected]

Records the current simulation tick.

Useful to determine how much time have elapsed since last simulation action.

Note:
Under ideal circumstances (not too heavy load), the current simulation tick multiplied by the simulation tick duration should correspond to the current user time, with the offset of the library initialization time t0 : (current time) - t0 = ( current simulation tick ) * ( simulation tick duration )
The scheduler has for purpose to enforce this property, but insufficient processing resources can make the simulation time drift : one should not rely on this property being verified. Therefore, this data member is the only one that is authoritative (the only actual value).

Definition at line 1118 of file OSDLScheduler.h.

Referenced by getCurrentSimulationTick(), and scheduleBestEffort().

Events::RenderingTick OSDL::Engine::Scheduler::_currentRenderingTick [protected]

Records the current rendering tick.

Useful to determine how much time have elapsed since last rendering action.

Note:
Under idel circumstances (not too heavy load), the current rendering tick multiplied by the rendering tick duration should correspond to the current user time, with the offset of the library initialization time t0: (current time) - t0 = ( current rendering tick ) * ( engine rendering duration )
The scheduler has for purpose to enforce this property, but insufficient processing resources can make the rendering time drift : one should not rely on this property being verified. Therefore, this data member is the only one that is authoritative (the only actual value).

Definition at line 1142 of file OSDLScheduler.h.

Referenced by getCurrentRenderingTick(), and scheduleBestEffort().

Events::RenderingTick OSDL::Engine::Scheduler::_currentInputTick [protected]

Records the current input tick.

Useful to determine how much time have elapsed since last input polling.

Note:
Under ideal circumstances (not too heavy load), the current input tick multiplied by the input tick duration should correspond to the current user time, with the offset of the library initialization time t0: (current time) - t0 = ( current input tick ) * ( engine input duration )
The scheduler has for purpose to enforce this property, but insufficient processing resources can make the input time drift : one should not rely on this property being verified. Therefore, this data member is the only one that is authoritative (the only actual value).

Definition at line 1166 of file OSDLScheduler.h.

Referenced by getCurrentInputTick(), and scheduleBestEffort().

Events::Period OSDL::Engine::Scheduler::_simulationPeriod [protected]

Duration between two successive simulation steps, expressed in engine ticks.

Definition at line 1174 of file OSDLScheduler.h.

Referenced by getSimulationTickCount(), and scheduleBestEffort().

Events::Period OSDL::Engine::Scheduler::_renderingPeriod [protected]

Duration between two successive rendering steps, expressed in engine ticks.

Definition at line 1182 of file OSDLScheduler.h.

Referenced by getRenderingTickCount(), and scheduleBestEffort().

Events::Period OSDL::Engine::Scheduler::_inputPeriod [protected]

Duration between two successive input steps, expressed in engine ticks.

Definition at line 1190 of file OSDLScheduler.h.

Referenced by getInputPollingTickCount(), and scheduleBestEffort().

Events::Hertz OSDL::Engine::Scheduler::_desiredSimulationFrequency [protected]

Records the user-defined simulation frequency.

Useful if the corresponding period had to be computed again after the engine tick duration changed.

Definition at line 1200 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Events::Hertz OSDL::Engine::Scheduler::_desiredRenderingFrequency [protected]

Records the user-defined rendering frequency.

Useful if the corresponding period had to be computed again after the engine tick duration changed.

Definition at line 1210 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Events::Hertz OSDL::Engine::Scheduler::_desiredInputFrequency [protected]

Records the user-defined input frequency.

Useful if the corresponding period had to be computed again after the engine tick duration changed.

Definition at line 1220 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::System::Callback OSDL::Engine::Scheduler::_idleCallback [protected]

The idle callback, if any, to be called by the scheduler.

Definition at line 1233 of file OSDLScheduler.h.

Referenced by onIdle(), and scheduleBestEffort().

void* OSDL::Engine::Scheduler::_idleCallbackData [protected]

The data, if any, to provide to the idle callback.

Definition at line 1240 of file OSDLScheduler.h.

Referenced by onIdle().

Ceylan::System::Microsecond OSDL::Engine::Scheduler::_idleCallbackMaxDuration [protected]

An estimated upper bound of the duration of current idle callback.

Helps the scheduler to respect its expected pace.

Definition at line 1250 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_idleCallsCount [protected]

Count the number of idle calls made during the current scheduler session.

Definition at line 1258 of file OSDLScheduler.h.

Referenced by onIdle(), and scheduleBestEffort().

bool OSDL::Engine::Scheduler::_stopRequested [protected]

Tells whether the scheduler has been requested to stop.

Definition at line 1263 of file OSDLScheduler.h.

Referenced by computeEngineTickFromCurrentTime(), scheduleBestEffort(), and stop().

Ceylan::System::Second OSDL::Engine::Scheduler::_scheduleStartingSecond [protected]

Stores the second when scheduling started.

Definition at line 1270 of file OSDLScheduler.h.

Referenced by computeEngineTickFromCurrentTime(), and scheduleBestEffort().

Ceylan::System::Microsecond OSDL::Engine::Scheduler::_scheduleStartingMicrosecond [protected]

Stores the microsecond when scheduling started.

Definition at line 1277 of file OSDLScheduler.h.

Referenced by computeEngineTickFromCurrentTime(), and scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_recoveredSimulationTicks [protected]

Records how many simulation ticks were recovered since the scheduler was started.

Definition at line 1286 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_missedSimulationTicks [protected]

Records how many simulation ticks were missed since the scheduler was started.

Definition at line 1294 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_recoveredRenderingTicks [protected]

Records how many rendering ticks were recovered since the scheduler was started.

Definition at line 1303 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_missedRenderingTicks [protected]

Records how many rendering ticks were missed since the scheduler was started.

Definition at line 1311 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_recoveredInputPollingTicks [protected]

Records how many input ticks were recovered since the scheduler was started.

Definition at line 1320 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_missedInputPollingTicks [protected]

Records how many input ticks were missed since the scheduler was started.

Definition at line 1328 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Ceylan::Uint32 OSDL::Engine::Scheduler::_scheduleFailureCount [protected]

Records how many schedule failures were reported.

Happens when the delay bucket reaches its first threashold.

Definition at line 1337 of file OSDLScheduler.h.

Referenced by scheduleBestEffort().

Events::EventsModule* OSDL::Engine::Scheduler::_eventsModule [protected]

References the events module, if necessary.

Note:
Used mostly when the scheduler has to poll inputs during input tick.

Definition at line 1347 of file OSDLScheduler.h.

Referenced by schedule().

Rendering::Renderer* OSDL::Engine::Scheduler::_renderer [protected]

References the renderer to be used, if any.

Definition at line 1354 of file OSDLScheduler.h.

Referenced by getRenderer(), hasRenderer(), schedule(), and ~Scheduler().

Video::VideoModule* OSDL::Engine::Scheduler::_videoModule [protected]

References the video module, if necessary.

Note:
Used mostly when the scheduler is not linked to a renderer. In this case, at each rendering tick the scheduler calls the redraw method of the video module. It allows scheduled objects to manage on their own the display, instead of using a full-blown dedicated renderer.

Definition at line 1368 of file OSDLScheduler.h.

Referenced by schedule().

Scheduler * Scheduler::_internalScheduler [static, private]

The internal single instance of scheduler, if any.

Definition at line 1398 of file OSDLScheduler.h.

Referenced by DeleteExistingScheduler(), DeleteScheduler(), GetExistingScheduler(), and GetScheduler().


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:26 2007 for OSDL by  doxygen 1.5.1