Skip to main content

AVxcelerate Simulation Framework 2025 R2 SP02

simulation_framework::core::time::IClock Class Reference

Last update: 19.09.2025

Interface for managing and manipulating simulation time. More...

#include <i_clock.h>

Inheritance diagram for simulation_framework::core::time::IClock:

Public Member Functions

virtual ~IClock ()=default
 Virtual destructor.
 
virtual void SetNow (const milliseconds &ms)=0
 Sets the current simulation time.
 
virtual void SetNow (const Timestamp &timestamp)=0
 Sets the current simulation time using a timestamp.
 
virtual milliseconds GetNow () const =0
 Gets the current simulation time in milliseconds.
 
virtual Timestamp GetNowAsTimestamp () const =0
 Gets the current simulation time as a timestamp.
 
virtual void IncrementBy (const milliseconds &ms)=0
 Increments the simulation time by a specified duration.
 

Detailed Description

Interface for managing and manipulating simulation time.

The IClock class provides a generic interface for handling simulation time. It allows setting the current simulation time, retrieving it in different formats, and incrementing time by a specified duration.

This interface is particularly useful in simulations where time needs to be controlled programmatically rather than relying on real-world time progression.

Definition at line 38 of file i_clock.h.

Constructor & Destructor Documentation

◆ ~IClock()

virtual simulation_framework::core::time::IClock::~IClock ( )
virtualdefault

Virtual destructor.

Ensures proper cleanup of derived classes.

Member Function Documentation

◆ GetNow()

virtual milliseconds simulation_framework::core::time::IClock::GetNow ( ) const
pure virtual

Gets the current simulation time in milliseconds.

This method returns the current simulation time as a duration measured in milliseconds since the epoch (0 milliseconds).

Returns
The current simulation time as a milliseconds object.

Implemented in simulation_framework::core::time::Clock.

◆ GetNowAsTimestamp()

virtual Timestamp simulation_framework::core::time::IClock::GetNowAsTimestamp ( ) const
pure virtual

Gets the current simulation time as a timestamp.

This method returns the current simulation time as a Timestamp object, providing a more precise representation of the current point in time.

Returns
The current simulation time as a Timestamp object.

Implemented in simulation_framework::core::time::Clock.

◆ IncrementBy()

virtual void simulation_framework::core::time::IClock::IncrementBy ( const milliseconds &  ms)
pure virtual

Increments the simulation time by a specified duration.

This method adds the given duration (in milliseconds) to the current simulation time. It is useful for progressing the simulation clock in a controlled manner.

Parameters
msThe duration to add to the current simulation time.

Implemented in simulation_framework::core::time::Clock.

◆ SetNow() [1/2]

virtual void simulation_framework::core::time::IClock::SetNow ( const milliseconds &  ms)
pure virtual

Sets the current simulation time.

This method allows setting the simulation's current time to a specific duration from the epoch (0 milliseconds).

Parameters
msThe time to set, represented as milliseconds from the epoch.

Implemented in simulation_framework::core::time::Clock.

◆ SetNow() [2/2]

virtual void simulation_framework::core::time::IClock::SetNow ( const Timestamp &  timestamp)
pure virtual

Sets the current simulation time using a timestamp.

This method sets the simulation's current time to a specific point in time, represented as a Timestamp object.

Parameters
timestampThe point in time to set as the current simulation time.

Implemented in simulation_framework::core::time::Clock.


The documentation for this class was generated from the following file:

Connect with Ansys