Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Timer Struct Referenceabstract

A timer to meassure time lapses. More...

#include <C:/Trend/Development/Trax3/Code/trax/Timer.h>

Inheritance diagram for trax::Timer:

Public Member Functions

virtual const char * TypeName () const noexcept=0
virtual void Start () noexcept=0
 Starts the timer.
virtual bool IsStarted () const noexcept=0
virtual void Reset () noexcept=0
 Resets the timer.
virtual void Pause () noexcept=0
 Pauses the timer.
virtual void Lapse (Time timeLapse)=0
 Sets the time span for the timer.
virtual Time Lapse () const =0
virtual void Periodic (bool bPeriodic)=0
 Sets wether the timer tick is happening only once or periodically.
virtual bool Periodic () const =0
virtual void SetTime (Time time)=0
 Sets the currect time of the timer.
virtual Time GetTime () const =0
virtual MultiPlugPlugToStart () noexcept=0
 Plug whose pulses starts the timer.
virtual MultiPlugPlugToReset () noexcept=0
 Plug whose pulses resets the timer.
virtual MultiPlugPlugToPause () noexcept=0
 Plug whose pulses pauses the timer.
virtual JackJackOnStart () noexcept=0
 If the timer is started, this Jack is triggered.
virtual JackJackOnReset () noexcept=0
 If the timer is reset, this Jack is triggered.
virtual JackJackOnPause () noexcept=0
 If the timer is set to paused, this Jack is triggered.
virtual JackJackOnTick () noexcept=0
 If the timer decides that time is up it triggers a pulse in this Jack.
virtual void RegisterSockets (SocketRegistry &registry)=0
 Registers all the Plugs with the registry and supplies the Jacks with plug ids for connecting.
virtual void UnregisterSockets (SocketRegistry &registry)=0
 Removes all references to Plugs and Jacks from the registry.
virtual void Update ()=0
Public Member Functions inherited from trax::Identified< Timer >
virtual const std::string & Reference (const std::string &name) const=0
 Gets a reference that was set for this object by name.
virtual const std::vector< char const * > & ReferenceNames (const std::string &namePart) const=0
 Searches for all reference names that countain namePart as substring in the name.
virtual IDType ID () const noexcept=0
 Identified (const Identified &)=delete
Identified & operator= (const Identified &)=delete

Static Public Member Functions

static dclspc std::unique_ptr< TimerMake () noexcept
 Makes a Timer object.

Detailed Description

A timer to meassure time lapses.

The timer will pulse its Jack in that simulation step in which the time lapse is reached. This limits the accuracy of the timing event to +- fixed_timestep.

Member Function Documentation

◆ GetTime()

virtual Time trax::Timer::GetTime ( ) const
pure virtual
Returns
the current time of the timer.

◆ IsStarted()

virtual bool trax::Timer::IsStarted ( ) const
pure virtualnoexcept
Returns
true if the timer is running.

◆ Lapse() [1/2]

virtual Time trax::Timer::Lapse ( ) const
pure virtual
Returns
the time span for the timer.

◆ Lapse() [2/2]

virtual void trax::Timer::Lapse ( Time timeLapse)
pure virtual

Sets the time span for the timer.

The default time span is fixed_timestep.

Parameters
timeLapsetime span.
Exceptions
std::invalid_argumentif timeLapse < fixed_timestep.

◆ Pause()

virtual void trax::Timer::Pause ( )
pure virtualnoexcept

Pauses the timer.

Does not change the time value. It will not tick until it gets started again.

◆ Periodic() [1/2]

virtual bool trax::Timer::Periodic ( ) const
pure virtual
Returns
true if the timer is set to be periodic.

◆ Periodic() [2/2]

virtual void trax::Timer::Periodic ( bool bPeriodic)
pure virtual

Sets wether the timer tick is happening only once or periodically.

The default is to pulse only once.

◆ Reset()

virtual void trax::Timer::Reset ( )
pure virtualnoexcept

Resets the timer.

Sets the time value to 0. It will not tick until it gets started again.

◆ SetTime()

virtual void trax::Timer::SetTime ( Time time)
pure virtual

Sets the currect time of the timer.

Parameters
timeTime in milliseconds.

◆ Start()

virtual void trax::Timer::Start ( )
pure virtualnoexcept

Starts the timer.

The timer will tick after the time lapse is over.

◆ TypeName()

virtual const char * trax::Timer::TypeName ( ) const
pure virtualnoexcept
Returns
the name for the object type that implements this interface.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/Timer.h