Class CSimulationTaskTimerService#
Defined in File simulationtasktimer.h
Inheritance Relationships#
Base Types#
public sdv::CSdvObject
(Class CSdvObject)public sdv::IObjectControl
(Struct IObjectControl)public sdv::core::ITaskTimer
(Struct ITaskTimer)public sdv::core::ITimerSimulationStep
(Struct ITimerSimulationStep)
Class Documentation#
-
class CSimulationTaskTimerService : public sdv::CSdvObject, public sdv::IObjectControl, public sdv::core::ITaskTimer, public sdv::core::ITimerSimulationStep#
Task timer class to execute task periodically.
Public Functions
-
CSimulationTaskTimerService()#
Constructor configure and initializes the timer.
-
virtual ~CSimulationTaskTimerService() override#
Destructor cleans up the timer if there is no active task and delete it after.
-
virtual void Initialize(const sdv::u8string &ssObjectConfig) override#
Initialize the object. Overload of sdv::IObjectControl::Initialize.
- Parameters:
ssObjectConfig – [in] Optional configuration string.
-
virtual sdv::EObjectStatus GetStatus() const override#
Get the current status of the object. Overload of sdv::IObjectControl::GetStatus.
- Returns:
Return the current status of the object.
-
virtual void SetOperationMode(sdv::EOperationMode eMode) override#
Set the component operation mode. Overload of sdv::IObjectControl::SetOperationMode.
- Parameters:
eMode – [in] The operation mode, the component should run in.
-
virtual void Shutdown() override#
Shutdown called before the object is destroyed. Overload of sdv::IObjectControl::Shutdown.
- Attention
Implement calls to other SDV objects here as this is no longer considered safe during the destructor of the object! After a call to shutdown any threads/callbacks/etc that could call other SDV objects need to have been stopped. The SDV object itself is to remain in a state where it can respond to calls to its interfaces as other objects may still call it during the shutdown sequence! Any subsequent call to GetStatus should return EObjectStatus::destruction_pending
-
virtual sdv::IInterfaceAccess *CreateTimer(uint32_t uiPeriod, sdv::IInterfaceAccess *pTask) override#
Method to execute the user-defined task periodically until ShutdownTask is called.
- Parameters:
uiPeriod – [in] The time period in milliseconds in which the task should executed.
pTask – [in] Interface to the task object exposing the ITaskExecute interface. The object must be kept alive until the timer has been destroyed.
- Returns:
Returns an interface to the task timer object. Use sdv::IObjectDestroy to terminate the timer.
-
virtual void SimulationStep(uint64_t uiSimulationStep) override#
Method to set the time which has past from the last simulation step.
- Parameters:
uiSimulationStep – [in] the time in microseconds which has past from the last simulation step.
-
void RemoveTimer(CSimulationTimer *pTimer)#
Remove the timer from from the timer map.
- Parameters:
pTimer – [in] Pointer to the timer object to remove.
-
CSimulationTaskTimerService()#