    

 ## On this page

  

 

 # simulation\_framework::standalone\_activity\_service::StandaloneActivityService Class Reference

 Last update: 16.07.2025 

It provides a running process of desired activity returned by interface [IStandaloneActivityCreator](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml "This is the interface class for creating a standalone activity service. It defines how a customized a...") and keeps it communicating and being scheduled by simulation framework core process. [More...](classsimulation__framework_1_1standalone__activity__service_1_1StandaloneActivityService.xhtml#details)

`#include <<a class="el" href="standalone__activity__service_8h_source.xhtml">standalone_activity_service.h</a>>`

## <a name="pub-methods"></a>Public Member Functions

 [StandaloneActivityService](classsimulation__framework_1_1standalone__activity__service_1_1StandaloneActivityService.xhtml#a79fe9c8ad17e14771664ad4cff12f6fe) (std::unique\_ptr&lt; [IStandaloneActivityCreator](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml) &gt; standalone\_activity\_creator) int [Run](classsimulation__framework_1_1standalone__activity__service_1_1StandaloneActivityService.xhtml#acb8a59ccc8e49b6a33fa1f37a1477412) () Start the Standalone Activity service and keep it alive waiting for standalone request on this Activity from simfwk core process (simfwk\_cli) [More...](classsimulation__framework_1_1standalone__activity__service_1_1StandaloneActivityService.xhtml#acb8a59ccc8e49b6a33fa1f37a1477412)  
 <a id="details" name="details"></a>## Detailed Description

It provides a running process of desired activity returned by interface [IStandaloneActivityCreator](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml "This is the interface class for creating a standalone activity service. It defines how a customized a...") and keeps it communicating and being scheduled by simulation framework core process.

If you have implemented my\_activity\_creator.h of interface [IStandaloneActivityCreator](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml "This is the interface class for creating a standalone activity service. It defines how a customized a...") based on example in simfwk-core/service/standalone\_activity\_service/standalone\_activity\_creator/i\_standalone\_activity\_creator.h, then you can create an executable using this class, which runs your desired activity as service, keep talking and being scheduled by simfwk\_cli.

This example shows how to implement this process and join the simulation from standalone

\#include "core/service/standalone\_activity\_service/standalone\_activity\_service.h"

\#include "core/my\_activity\_creator.h"

 

int main()

{

 using namespace simulation_framework::standalone_activity_service;

 

 std::unique_ptr&lt;IStandaloneActivityCreator&gt; my_activity_creator =

 std::make_unique&lt;MyActivityCreator&gt;("my\_activity\_name");

 

 auto [standalone\_activity\_service](namespacestandalone__activity__service.xhtml) =

 std::make_unique&lt;StandaloneActivityService&gt;(std::move(my_activity_creator));

 

 return [standalone\_activity\_service](namespacestandalone__activity__service.xhtml)-&gt;Run();

}





## Constructor &amp; Destructor Documentation

<a id="a79fe9c8ad17e14771664ad4cff12f6fe"></a>## [◆ ](#a79fe9c8ad17e14771664ad4cff12f6fe)StandaloneActivityService()

 simulation\_framework::standalone\_activity\_service::StandaloneActivityService::StandaloneActivityService  ( std::unique\_ptr&lt; [IStandaloneActivityCreator](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml) &gt;  *standalone\_activity\_creator*) 

Construct an Standalone Activity as Service to join simulation standalonely

Parameters standalone\_activity\_creatorAn interface defines how the activity should be instanciated 



## Member Function Documentation

<a id="acb8a59ccc8e49b6a33fa1f37a1477412"></a>## [◆ ](#acb8a59ccc8e49b6a33fa1f37a1477412)Run()

 int simulation\_framework::standalone\_activity\_service::StandaloneActivityService::Run  ( ) 

Start the Standalone Activity service and keep it alive waiting for standalone request on this Activity from simfwk core process (simfwk\_cli)

ReturnsProgramm return code which indicates whether the Standalone Activity is healthy 



---

The documentation for this class was generated from the following file:- [standalone\_activity\_service.h](standalone__activity__service_8h_source.xhtml)