The ITimeframe interface. More...
#include "murl_logic_i_timeframe.h"
Public Member Functions | |
virtual IStepablePtr | GetStepable ()=0 |
Get the stepable interface shared pointer. More... | |
virtual void | Reset ()=0 |
Reset the timeframe. More... | |
virtual void | Start ()=0 |
Start the timeframe. More... | |
virtual void | Start (Real endTime)=0 |
Start the timeframe with a specified interval. More... | |
virtual Bool | SetCurrentTime (Real time)=0 |
Set the current time. More... | |
virtual Bool | Finish ()=0 |
Finish the timeframe. More... | |
virtual Bool | IsRunning () const =0 |
Check if the timeframe is running. More... | |
virtual Bool | WasStarted () const =0 |
Check if the timeframe was started from the beginning. More... | |
virtual Bool | WasRunning () const =0 |
Check if the timeframe has finished. More... | |
virtual Bool | IsOrWasRunning () const =0 |
Check if the timeframe is or was running. More... | |
virtual Bool | HasPassedTime (Real time) const =0 |
Check if the current time has passed a specified time within the most recent tick. More... | |
virtual Bool | SetTimeScale (Real timeScale)=0 |
Set the time scale factor. More... | |
virtual Real | GetTimeScale () const =0 |
Get the time scale factor. More... | |
virtual Bool | SetEndTime (Real endTime)=0 |
Set the end time. More... | |
virtual Real | GetEndTime () const =0 |
Get the end time. More... | |
virtual Double | GetCurrentTime () const =0 |
Get the current time. More... | |
virtual Double | GetRemainingTime () const =0 |
Get the remaining time. More... | |
Detailed Description
The ITimeframe interface.
The timeframe is evaluated each logic tick using the IStepable interface.
A timeframe is a lightweight object for measuring a time interval.
Member Function Documentation
◆ GetStepable()
|
pure virtual |
Get the stepable interface shared pointer.
The ITimeframe conforms to the IStepable interface.
- Returns
- The stepable interface shared pointer.
Implemented in Murl::Logic::Timeframe.
◆ Reset()
|
pure virtual |
Reset the timeframe.
Stop the timeframe, set the current time to zero and reset the WasRunning() state.
Implemented in Murl::Logic::Timeframe.
◆ Start() [1/2]
|
pure virtual |
Start the timeframe.
The time starts with current time zero and is evaluated until the end time is reached.
Implemented in Murl::Logic::Timeframe.
◆ Start() [2/2]
|
pure virtual |
Start the timeframe with a specified interval.
The time starts with current time zero and is evaluated until the end time is reached.
- Parameters
-
endTime The time interval in seconds.
Implemented in Murl::Logic::Timeframe.
◆ SetCurrentTime()
Set the current time.
Modify the current time if the timeframe is running and the new time is within the interval [0 .. end time].
- Parameters
-
time The current time in seconds.
- Returns
- true if successful.
Implemented in Murl::Logic::Timeframe.
◆ Finish()
|
pure virtual |
Finish the timeframe.
Set the current time to the end time and the WasRunning() state to true if the timeframe is running.
- Returns
- true if successful.
Implemented in Murl::Logic::Timeframe.
◆ IsRunning()
|
pure virtual |
Check if the timeframe is running.
A timeframe can be started by calling Start() and stopped by calling Finish() or Reset().
- Returns
- true if running.
Implemented in Murl::Logic::Timeframe.
◆ WasStarted()
|
pure virtual |
Check if the timeframe was started from the beginning.
- Returns
- true if started.
Implemented in Murl::Logic::Timeframe.
◆ WasRunning()
|
pure virtual |
Check if the timeframe has finished.
If the timeframe is finished this state is true within the current logic tick only and will be cleared at the next logic tick.
(!) This state remains unchanged if the processor holding the timeframe's observer is set to inactive within the current logic tick. In such a case the Reset() method can be called to clear the state.
- Returns
- true if finished.
Implemented in Murl::Logic::Timeframe.
◆ IsOrWasRunning()
|
pure virtual |
Check if the timeframe is or was running.
Returns (IsRunning() || WasRunning()) state.
- Returns
- true if IsRunning() or WasRunning() is true.
Implemented in Murl::Logic::Timeframe.
◆ HasPassedTime()
Check if the current time has passed a specified time within the most recent tick.
- Parameters
-
time The time to check in seconds.
- Returns
- true if the current time has passed a specified time within the most recent tick.
Implemented in Murl::Logic::Timeframe.
◆ SetTimeScale()
Set the time scale factor.
The recent tick duration is multiplied by the time scale factor and added to the current time each logic tick. The default time scale factor is 1.
- Parameters
-
timeScale The time scale factor.
- Returns
- true if successful.
Implemented in Murl::Logic::Timeframe.
◆ GetTimeScale()
|
pure virtual |
◆ SetEndTime()
Set the end time.
- Parameters
-
endTime The end time in seconds.
- Returns
- true if successful.
Implemented in Murl::Logic::Timeframe.
◆ GetEndTime()
|
pure virtual |
◆ GetCurrentTime()
|
pure virtual |
◆ GetRemainingTime()
|
pure virtual |
Get the remaining time.
This method calculates GetEndTime() - GetCurrentTime().
- Returns
- The remaining time in seconds.
Implemented in Murl::Logic::Timeframe.
The documentation for this interface was generated from the following file:
- murl_logic_i_timeframe.h