Murl::Logic::ITimeframe Interface Referenceabstract

The ITimeframe interface. More...

#include "murl_logic_i_timeframe.h"

Inheritance diagram for Murl::Logic::ITimeframe:

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()

virtual IStepablePtr Murl::Logic::ITimeframe::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()

virtual void Murl::Logic::ITimeframe::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]

virtual void Murl::Logic::ITimeframe::Start ( )
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]

virtual void Murl::Logic::ITimeframe::Start ( Real  endTime)
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
endTimeThe time interval in seconds.

Implemented in Murl::Logic::Timeframe.

◆ SetCurrentTime()

virtual Bool Murl::Logic::ITimeframe::SetCurrentTime ( Real  time)
pure virtual

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
timeThe current time in seconds.
Returns
true if successful.

Implemented in Murl::Logic::Timeframe.

◆ Finish()

virtual Bool Murl::Logic::ITimeframe::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()

virtual Bool Murl::Logic::ITimeframe::IsRunning ( ) const
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()

virtual Bool Murl::Logic::ITimeframe::WasStarted ( ) const
pure virtual

Check if the timeframe was started from the beginning.

Returns
true if started.

Implemented in Murl::Logic::Timeframe.

◆ WasRunning()

virtual Bool Murl::Logic::ITimeframe::WasRunning ( ) const
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()

virtual Bool Murl::Logic::ITimeframe::IsOrWasRunning ( ) const
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()

virtual Bool Murl::Logic::ITimeframe::HasPassedTime ( Real  time) const
pure virtual

Check if the current time has passed a specified time within the most recent tick.

Parameters
timeThe 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()

virtual Bool Murl::Logic::ITimeframe::SetTimeScale ( Real  timeScale)
pure virtual

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
timeScaleThe time scale factor.
Returns
true if successful.

Implemented in Murl::Logic::Timeframe.

◆ GetTimeScale()

virtual Real Murl::Logic::ITimeframe::GetTimeScale ( ) const
pure virtual

Get the time scale factor.

Returns
The time scale factor.

Implemented in Murl::Logic::Timeframe.

◆ SetEndTime()

virtual Bool Murl::Logic::ITimeframe::SetEndTime ( Real  endTime)
pure virtual

Set the end time.

Parameters
endTimeThe end time in seconds.
Returns
true if successful.

Implemented in Murl::Logic::Timeframe.

◆ GetEndTime()

virtual Real Murl::Logic::ITimeframe::GetEndTime ( ) const
pure virtual

Get the end time.

Returns
The end time in seconds.

Implemented in Murl::Logic::Timeframe.

◆ GetCurrentTime()

virtual Double Murl::Logic::ITimeframe::GetCurrentTime ( ) const
pure virtual

Get the current time.

Returns
The current time in seconds.

Implemented in Murl::Logic::Timeframe.

◆ GetRemainingTime()

virtual Double Murl::Logic::ITimeframe::GetRemainingTime ( ) const
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


Copyright © 2011-2018 Spraylight GmbH.