WSF
WsfClockSource Class Reference

Maintain the current simulation clock. More...

#include <WsfClockSource.hpp>

Inheritance diagram for WsfClockSource:

Public Member Functions

 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 GetClock (double aClock) const
 Return the current simulation clock.
virtual void ResetClock (double aAccumulatedTime=0.0)
 Reset the simulation clock back to zero.
virtual void SetClock (double aClock)
 Set the clock to a specified value.
virtual void SetClockRate (double aClockRate)
 Set the clock rate multiplier.
virtual double GetClockRate () const
 Get the clock rate multiplier.
virtual void StartClock ()
 Start the clock.
virtual void StopClock ()
 Stop (pause) the clock.
virtual void SetMaximumClock (double aClock)
 Set the clock's maximum time.
bool IsStopped () const
 Return whether the clock is paused.

Protected Attributes

double mClockRate {1.0}
bool mClockPaused {false}
double mMaximumClock {1.0E300}

Detailed Description

Maintain the current simulation clock.

Constructor & Destructor Documentation

◆ WsfClockSource() [1/3]

WsfClockSource::WsfClockSource ( )
default

◆ ~WsfClockSource()

virtual WsfClockSource::~WsfClockSource ( )
virtualdefault

◆ WsfClockSource() [2/3]

WsfClockSource::WsfClockSource ( const WsfClockSource & aSrc)
delete

References WsfClockSource().

◆ WsfClockSource() [3/3]

WsfClockSource::WsfClockSource ( WsfClockSource && aSrc)
delete

References WsfClockSource().

Member Function Documentation

◆ GetClock()

double WsfClockSource::GetClock ( double aClock) const
virtual

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 in WsfRealTimeClockSource.

References mMaximumClock.

Referenced by operator=().

◆ GetClockRate()

double WsfClockSource::GetClockRate ( ) const
virtual

◆ IsStopped()

bool WsfClockSource::IsStopped ( ) const
inline

Return whether the clock is paused.

References mClockPaused.

Referenced by WsfXIO_SimTimeService::UpdateRequestInterval().

◆ operator=() [1/2]

WsfClockSource & WsfClockSource::operator= ( const WsfClockSource & aRhs)
delete

References WsfClockSource().

◆ operator=() [2/2]

◆ ResetClock()

void WsfClockSource::ResetClock ( double aAccumulatedTime = 0.0)
virtual

Reset the simulation clock back to zero.

Reimplemented in WsfRealTimeClockSource.

Referenced by operator=().

◆ SetClock()

void WsfClockSource::SetClock ( double aClock)
virtual

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 in WsfRealTimeClockSource.

Referenced by operator=(), and WsfRealTimeClockSource::SetClock().

◆ SetClockRate()

void WsfClockSource::SetClockRate ( double aClockRate)
virtual

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 in WsfRealTimeClockSource.

References mClockRate.

Referenced by operator=(), and WsfRealTimeClockSource::SetClockRate().

◆ SetMaximumClock()

void WsfClockSource::SetMaximumClock ( double aClock)
virtual

Set the clock's maximum time.

Reimplemented in WsfRealTimeClockSource.

References mMaximumClock.

Referenced by operator=(), and WsfRealTimeClockSource::SetMaximumClock().

◆ StartClock()

void WsfClockSource::StartClock ( )
virtual

Start the clock.

Reimplemented in WsfRealTimeClockSource.

References mClockPaused.

Referenced by operator=().

◆ StopClock()

void WsfClockSource::StopClock ( )
virtual

Stop (pause) the clock.

Reimplemented in WsfRealTimeClockSource.

References mClockPaused.

Referenced by operator=().

Member Data Documentation

◆ mClockPaused

◆ mClockRate

◆ mMaximumClock


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