|
WSF
|
A specialization of WsfClockSource to support a real-time clock. More...
#include <WsfRealTimeClockSource.hpp>


Public Member Functions | |
| WsfRealTimeClockSource () | |
| ~WsfRealTimeClockSource () override | |
| double | GetClock (double aClock) const override |
| Return the current simulation clock. | |
| void | ResetClock (double aAccumulatedTime=0.0) override |
| Reset the simulation clock back to zero. | |
| void | SetClock (double aClock) override |
| Set the clock to a specified value. | |
| void | SetClockRate (double aClockRate) override |
| Set the clock rate multiplier. | |
| void | StartClock () override |
| Start the clock. | |
| void | StopClock () override |
| Stop (pause) the clock. | |
| void | SetMaximumClock (double aClock) override |
| Set the clock's maximum time. | |
| void | SetQuietMode (bool aQuietMode) |
| Suppresses output of messages to the screen. | |
| double | GetElapsedWallTime () |
| Get the Elapsed wallclock time since the last reset (start, stop, ratechange, etc). | |
| void | SetTimingMethod (UtWallClock::TimingMethod aTimingMethod) |
| Set the timing method used by the underlying clock. | |
| Public Member Functions inherited from WsfClockSource | |
| WsfClockSource ()=default | |
| virtual | ~WsfClockSource ()=default |
| WsfClockSource (const WsfClockSource &aSrc)=delete | |
| WsfClockSource & | operator= (const WsfClockSource &aRhs)=delete |
| WsfClockSource (WsfClockSource &&aSrc)=delete | |
| WsfClockSource & | operator= (WsfClockSource &&aRhs)=delete |
| virtual double | GetClockRate () const |
| Get the clock rate multiplier. | |
| bool | IsStopped () const |
| Return whether the clock is paused. | |
Additional Inherited Members | |
| Protected Attributes inherited from WsfClockSource | |
| double | mClockRate {1.0} |
| bool | mClockPaused {false} |
| double | mMaximumClock {1.0E300} |
A specialization of WsfClockSource to support a real-time clock.
See the base class for documentation.
| WsfRealTimeClockSource::WsfRealTimeClockSource | ( | ) |
References ResetClock().
|
override |
|
overridevirtual |
Return the current simulation clock.
The return value will be the lesser of the supplied argument (aClock) and the physical simulation clock (for example, the elapsed real-time in a real-time simulation).
This allows a simulation executive (like WsfEventStepSimulation) to interleave events with a real-time clock.
Reimplemented from WsfClockSource.
References WsfClockSource::mClockPaused, WsfClockSource::mClockRate, and WsfClockSource::mMaximumClock.
Referenced by SetClockRate(), and SetMaximumClock().
| double WsfRealTimeClockSource::GetElapsedWallTime | ( | ) |
Get the Elapsed wallclock time since the last reset (start, stop, ratechange, etc).
|
overridevirtual |
Reset the simulation clock back to zero.
Reimplemented from WsfClockSource.
References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.
Referenced by WsfRealTimeClockSource().
|
overridevirtual |
Set the clock to a specified value.
This method should be used with great caution! It should only be used when the clock is in a stopped (paused) state and should not set the clock backwards!
Reimplemented from WsfClockSource.
References WsfClockSource::mClockPaused, WsfClockSource::mMaximumClock, and WsfClockSource::SetClock().
|
overridevirtual |
Set the clock rate multiplier.
The clock rate multiplier allows SIMULATION time to flow faster or slower than the physical clock. Note that this only makes sense if the derived class is based on some concept of physical time.
Reimplemented from WsfClockSource.
References GetClock(), WsfClockSource::mClockPaused, and WsfClockSource::SetClockRate().
|
overridevirtual |
Set the clock's maximum time.
Reimplemented from WsfClockSource.
References GetClock(), WsfClockSource::mMaximumClock, and WsfClockSource::SetMaximumClock().
| void WsfRealTimeClockSource::SetQuietMode | ( | bool | aQuietMode | ) |
Suppresses output of messages to the screen.
Referenced by WsfXIO_TimeSynchronization::WsfXIO_TimeSynchronization().
| void WsfRealTimeClockSource::SetTimingMethod | ( | UtWallClock::TimingMethod | aTimingMethod | ) |
Set the timing method used by the underlying clock.
|
overridevirtual |
Start the clock.
Reimplemented from WsfClockSource.
References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.
|
overridevirtual |
Stop (pause) the clock.
Reimplemented from WsfClockSource.
References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.