WSF
WsfRealTimeClockSource.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFREALTIMECLOCKSOURCE_HPP
13#define WSFREALTIMECLOCKSOURCE_HPP
14
15#include "wsf_export.h"
16
17#include "UtWallClock.hpp"
18#include "WsfClockSource.hpp"
19
25
27{
28public:
30 ~WsfRealTimeClockSource() override;
31
32 double GetClock(double aClock) const override;
33
34 void ResetClock(double aAccumulatedTime = 0.0) override;
35
36 void SetClock(double aClock) override;
37
38 void SetClockRate(double aClockRate) override;
39
40 void StartClock() override;
41
42 void StopClock() override;
43
44 void SetMaximumClock(double aClock) override;
45
46 void SetQuietMode(bool aQuietMode);
47
48 double GetElapsedWallTime();
49
50 void SetTimingMethod(UtWallClock::TimingMethod aTimingMethod);
51
52private:
53 // The wall clock object is used to maintain the elapsed REAL time
54 // since the clock was last started.
55
56 UtWallClock mWallClock;
57
58 // The accumulated time is the elapsed SIMULATION time when the clock
59 // was last started. This value is updated with the current SIMULATION
60 // time whenever the clock is stopped.
61
62 double mTimeAccumulated;
63
64 bool mQuietMode;
65};
66
67#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
virtual void StartClock()
Start the clock.
Definition WsfClockSource.cpp:76
virtual void SetClockRate(double aClockRate)
Set the clock rate multiplier.
Definition WsfClockSource.cpp:59
virtual double GetClock(double aClock) const
Return the current simulation clock.
Definition WsfClockSource.cpp:25
virtual void SetClock(double aClock)
Set the clock to a specified value.
Definition WsfClockSource.cpp:49
WsfClockSource()=default
virtual void ResetClock(double aAccumulatedTime=0.0)
Reset the simulation clock back to zero.
Definition WsfClockSource.cpp:39
virtual void SetMaximumClock(double aClock)
Set the clock's maximum time.
Definition WsfClockSource.cpp:94
virtual void StopClock()
Stop (pause) the clock.
Definition WsfClockSource.cpp:85
WsfRealTimeClockSource()
Definition WsfRealTimeClockSource.cpp:20
void SetQuietMode(bool aQuietMode)
Suppresses output of messages to the screen.
Definition WsfRealTimeClockSource.cpp:145
void SetTimingMethod(UtWallClock::TimingMethod aTimingMethod)
Set the timing method used by the underlying clock.
Definition WsfRealTimeClockSource.cpp:159
double GetElapsedWallTime()
Get the Elapsed wallclock time since the last reset (start, stop, ratechange, etc).
Definition WsfRealTimeClockSource.cpp:152
Copyrights Multiple, All Rights Reserved