A timer to meassure time lapses.
More...
#include <C:/Trend/Development/Trax3/Code/trax/Timer.h>
|
| 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 MultiPlug & | PlugToStart () noexcept=0 |
| | Plug whose pulses starts the timer.
|
|
virtual MultiPlug & | PlugToReset () noexcept=0 |
| | Plug whose pulses resets the timer.
|
|
virtual MultiPlug & | PlugToPause () noexcept=0 |
| | Plug whose pulses pauses the timer.
|
|
virtual Jack & | JackOnStart () noexcept=0 |
| | If the timer is started, this Jack is triggered.
|
|
virtual Jack & | JackOnReset () noexcept=0 |
| | If the timer is reset, this Jack is triggered.
|
|
virtual Jack & | JackOnPause () noexcept=0 |
| | If the timer is set to paused, this Jack is triggered.
|
|
virtual Jack & | JackOnTick () noexcept=0 |
| | If the timer decides that time is up it triggers a pulse in this Jack.
|
|
virtual void | RegisterSockets (SocketRegistry ®istry)=0 |
| | Registers all the Plugs with the registry and supplies the Jacks with plug ids for connecting.
|
|
virtual void | UnregisterSockets (SocketRegistry ®istry)=0 |
| | Removes all references to Plugs and Jacks from the registry.
|
|
virtual void | Update ()=0 |
| 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 dclspc std::unique_ptr< Timer > | Make () noexcept |
| | Makes a Timer object.
|
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.
◆ 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
-
- Exceptions
-
| std::invalid_argument | if 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
-
| time | Time 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