#include <MultiClock.h>
◆ cancelClockEvent()
Cancels a previously scheduled clock event.
The clock event ownership is transferred to the caller.
Implements inet::IClock.
◆ computeClockTimeFromSimTime()
| virtual clocktime_t inet::MultiClock::computeClockTimeFromSimTime |
( |
simtime_t |
time | ) |
const |
|
inlineoverridevirtual |
Returns the clock time for the specified future simulation time according to the current state of the clock.
This method implements a monotonic function with respect to the simulation time argument. It's allowed to return a different value for the same argument value if the clock is set between calls. The time argument must be greater than or equal to the current simulation time, otherwise an error is raised. See SIMTIME_AS_CLOCKTIME macro for simple type conversion.
Implements inet::IClock.
◆ computeSimTimeFromClockTime()
| virtual simtime_t inet::MultiClock::computeSimTimeFromClockTime |
( |
clocktime_t |
time | ) |
const |
|
inlineoverridevirtual |
Returns the simulation time (first moment) for the specified future clock time according to the current state of the clock.
This method implements a monotonic function with respect to the clock time argument. It's allowed to return a different value for the same argument value if the clock is set between calls. The time argument must be greater or than equal to the current clock time, otherwise an error is raised. See CLOCKTIME_AS_SIMTIME macro for simple type conversion.
Implements inet::IClock.
◆ getClockTime()
| virtual clocktime_t inet::MultiClock::getClockTime |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the current clock time.
Note that the clock time is not necessarily monotonous in execution order. For example, the clock time may decrease even at the same simulation time.
Implements inet::IClock.
Referenced by handleParameterChange().
◆ handleClockEvent()
| virtual void inet::MultiClock::handleClockEvent |
( |
ClockEvent * |
event | ) |
|
|
inlineoverridevirtual |
Called by the clock event to be executed in the context of this clock.
This method is primarily useful for clock implementations to update their internal data structures related to individual clock events.
Implements inet::IClock.
◆ handleParameterChange()
| void inet::MultiClock::handleParameterChange |
( |
const char * |
name | ) |
|
|
overrideprotectedvirtual |
26 if (name !=
nullptr) {
27 if (!strcmp(name,
"activeClockIndex")) {
29 activeClock = check_and_cast<IClock *>(getSubmodule(
"clock", par(
"activeClockIndex")));
◆ initialize()
| void inet::MultiClock::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
19 activeClock = check_and_cast<IClock *>(getSubmodule(
"clock", par(
"activeClockIndex")));
◆ receiveSignal()
| void inet::MultiClock::receiveSignal |
( |
cComponent * |
source, |
|
|
int |
signal, |
|
|
const simtime_t & |
time, |
|
|
cObject * |
details |
|
) |
| |
|
overridevirtual |
38 if (check_and_cast<IClock *>(source) ==
activeClock)
42 throw cRuntimeError(
"Unknown signal");
◆ scheduleClockEventAfter()
Schedules an event to be delivered to the caller module (i.e.
the context module) after the given clock time delay has elapsed. The event is anchored to a specific clock time duration, so the actual simulation time when this event is executed is not affected if the clock time is set later. On the other hand, setting the clock drift still affects the simulation time of the event execution.
Implements inet::IClock.
◆ scheduleClockEventAt()
Schedules an event to be delivered to the caller module (i.e.
the context module) at the specified clock time. The event is anchored to a specific clock time value, so the actual simulation time when this event is executed will be affected if the clock time is set later.
Implements inet::IClock.
◆ activeClock
| IClock* inet::MultiClock::activeClock = nullptr |
|
protected |
The documentation for this class was generated from the following files: