    

 ## On this page

  

 

 # simulation\_framework::core::StandaloneActivityService Class Reference

 Last update: 16.07.2025 

It provides a running process of desired activity returned by interface [IStandaloneActivityCreator](classsimulation__framework_1_1core_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_1core_1_1StandaloneActivityService.xhtml#details)

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

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

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

It provides a running process of desired activity returned by interface [IStandaloneActivityCreator](classsimulation__framework_1_1core_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_1core_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](classsimulation__framework_1_1core_1_1Topic.xhtml)()

{

 ;

 

 std::unique_ptr&lt;IStandaloneActivityCreator&gt; [my\_activity\_creator](classsimulation__framework_1_1core_1_1Topic.xhtml) =

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

 

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

 std::make_unique&lt;StandaloneActivityService&gt;(std::move([my\_activity\_creator](classsimulation__framework_1_1core_1_1Topic.xhtml)));

 

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

}

[simulation\_framework::core::Topic](classsimulation__framework_1_1core_1_1Topic.xhtml)

This is the concrete Topic class that can be used for creation of a communication channel with given ...

**Definition** [topic.h:38](topic_8h_source.xhtml#l00037)





Definition at line [50](standalone__activity__service_8h_source.xhtml#l00050) of file [standalone\_activity\_service.h](standalone__activity__service_8h_source.xhtml).



## Constructor &amp; Destructor Documentation

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

 simulation\_framework::core::StandaloneActivityService::StandaloneActivityService  ( std::unique\_ptr&lt; [IStandaloneActivityCreator](classsimulation__framework_1_1core_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="a421e29a06e115be20823def55afaede1" name="a421e29a06e115be20823def55afaede1"></a>## [◆ ](#a421e29a06e115be20823def55afaede1)Run()

 [int](classsimulation__framework_1_1core_1_1Topic.xhtml) simulation\_framework::core::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)