WSF
WsfRealTimeClockSource Class Reference

A specialization of WsfClockSource to support a real-time clock. More...

#include <WsfRealTimeClockSource.hpp>

Inheritance diagram for WsfRealTimeClockSource:
Collaboration diagram for WsfRealTimeClockSource:

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
WsfClockSourceoperator= (const WsfClockSource &aRhs)=delete
 WsfClockSource (WsfClockSource &&aSrc)=delete
WsfClockSourceoperator= (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}

Detailed Description

A specialization of WsfClockSource to support a real-time clock.

See the base class for documentation.

Constructor & Destructor Documentation

◆ WsfRealTimeClockSource()

WsfRealTimeClockSource::WsfRealTimeClockSource ( )

References ResetClock().

◆ ~WsfRealTimeClockSource()

WsfRealTimeClockSource::~WsfRealTimeClockSource ( )
override

Member Function Documentation

◆ GetClock()

double WsfRealTimeClockSource::GetClock ( double aClock) const
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().

◆ GetElapsedWallTime()

double WsfRealTimeClockSource::GetElapsedWallTime ( )

Get the Elapsed wallclock time since the last reset (start, stop, ratechange, etc).

◆ ResetClock()

void WsfRealTimeClockSource::ResetClock ( double aAccumulatedTime = 0.0)
overridevirtual

Reset the simulation clock back to zero.

Reimplemented from WsfClockSource.

References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.

Referenced by WsfRealTimeClockSource().

◆ SetClock()

void WsfRealTimeClockSource::SetClock ( double aClock)
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().

◆ SetClockRate()

void WsfRealTimeClockSource::SetClockRate ( double aClockRate)
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().

◆ SetMaximumClock()

void WsfRealTimeClockSource::SetMaximumClock ( double aClock)
overridevirtual

Set the clock's maximum time.

Reimplemented from WsfClockSource.

References GetClock(), WsfClockSource::mMaximumClock, and WsfClockSource::SetMaximumClock().

◆ SetQuietMode()

void WsfRealTimeClockSource::SetQuietMode ( bool aQuietMode)

Suppresses output of messages to the screen.

Referenced by WsfXIO_TimeSynchronization::WsfXIO_TimeSynchronization().

◆ SetTimingMethod()

void WsfRealTimeClockSource::SetTimingMethod ( UtWallClock::TimingMethod aTimingMethod)

Set the timing method used by the underlying clock.

◆ StartClock()

void WsfRealTimeClockSource::StartClock ( )
overridevirtual

Start the clock.

Reimplemented from WsfClockSource.

References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.

◆ StopClock()

void WsfRealTimeClockSource::StopClock ( )
overridevirtual

Stop (pause) the clock.

Reimplemented from WsfClockSource.

References WsfClockSource::mClockPaused, and WsfClockSource::mClockRate.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved