- Main Page
- Modules
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# cRealTimeScheduler Class Reference
[Internal classes]

`#include <cscheduler.h>`

Inheritance diagram for cRealTimeScheduler:

List of all members.

## Detailed Description

Real-time scheduler class.

When installed as scheduler using the scheduler-class omnetpp.ini entry, it will syncronize simulation execution to real (wall clock) time.

Operation: a "base time" is determined when startRun() is called. Later on, the scheduler object calls usleep() from getNextEvent() to synchronize the simulation time to real time, that is, to wait until the current time minus base time becomes equal to the simulation time. Should the simulation lag behind real time, this scheduler will try to catch up by omitting sleep calls altogether.

Scaling is supported via the realtimescheduler-scaling omnetpp.ini entry. For example, if it is set to 2.0, the simulation will try to execute twice as fast as real time.

## Public Member Functions
| cRealTimeScheduler ()
virtual | ~cRealTimeScheduler ()
virtual void | startRun ()
virtual void | endRun ()
virtual void | executionResumed ()
virtual cMessage * | getNextEvent ()

## Constructor & Destructor Documentation

cRealTimeScheduler::cRealTimeScheduler | ( |  | ) | `[inline]`

| Constructor.

virtual cRealTimeScheduler::~cRealTimeScheduler | ( |  | ) | `[inline, virtual]`

| Destructor.

## Member Function Documentation

virtual void cRealTimeScheduler::endRun | ( |  | ) | `[virtual]`

| Called at the end of a simulation run. Implements cScheduler.

virtual void cRealTimeScheduler::executionResumed | ( |  | ) | `[virtual]`

| Recalculates "base time" from current wall clock time. Reimplemented from cScheduler.

virtual cMessage* cRealTimeScheduler::getNextEvent | ( |  | ) | `[virtual]`

| Scheduler function -- it comes from cScheduler interface. This function synchronizes to real time: it waits (usleep()) until the real time reaches the time of the next simulation event. Implements cScheduler.

virtual void cRealTimeScheduler::startRun | ( |  | ) | `[virtual]`

| Called at the beginning of a simulation run. Implements cScheduler.

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

- cscheduler.h