    

 ## On this page

  

 

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

 Last update: 16.07.2025 

This is the interface class for creating a standalone activity service. It defines how a customized activity needs to be instantiated through or not through StandaloneInitData. [More...](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#details)

`#include <<a class="el" href="i__standalone__activity__creator_8h_source.xhtml">i_standalone_activity_creator.h</a>>`

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

virtual std::string [GetName](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#a1534824e56569105e521cbb28d62363c) ()=0 virtual core::lifecycle::IActivityPtr [Create](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#aba16240cc33bb6fa5a9eaef04ef78d9d) (\[\[maybe\_unused\]\] const core::scheduling::StandaloneInitData &amp;standalone\_init\_data)=0 Create an IActivityPtr which will be scheduled remotely through scheduling event. [More...](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#aba16240cc33bb6fa5a9eaef04ef78d9d)  
 <a id="details" name="details"></a>## Detailed Description

This is the interface class for creating a standalone activity service. It defines how a customized activity needs to be instantiated through or not through StandaloneInitData.

You have already the example how you create an activity "MyActivity" in [core/lifecycle/activity/base\_activity.h](base__activity_8h_source.xhtml)

This example shows how to implement the [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...") interface based on "MyActivity"

using TopicToBePublished = Topic&lt;MsgToBePublished&gt;;

using TopicSubscribingOn = Topic&lt;MsgSubscribingOn&gt;;

 

class MyActivityCreator : public IStandaloneActivityCreator

{

 public:

 MyActivityCreator(const std::string&amp; name) : standalone_activity_name_(name) {}

 IActivityPtr [Create](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#aba16240cc33bb6fa5a9eaef04ef78d9d)(const core::scheduling::StandaloneInitData&amp; standalone_init_data) override

 {

 TopicPtr topic_going_to_publish = std::make_shared&lt;TopicToBePublished&gt;("TopicToBePublished");

 TopicPtr topic_want_to_receive = std::make_shared&lt;TopicSubscribingOn&gt;("TopicSubscribingOn");

 

 return std::make_unique&lt;MyActivity&gt;(

 standalone_activity_name_, Topics{topic_going_to_publish, topic_want_to_receive}, MyLogic{});

 }

 std::string [GetName](classsimulation__framework_1_1standalone__activity__service_1_1IStandaloneActivityCreator.xhtml#a1534824e56569105e521cbb28d62363c)() override { return standalone_activity_name_; }

 

 private:

 std::string standalone_activity_name_;

};





## Member Function Documentation

<a id="aba16240cc33bb6fa5a9eaef04ef78d9d"></a>## [◆ ](#aba16240cc33bb6fa5a9eaef04ef78d9d)Create()

 virtual core::lifecycle::IActivityPtr simulation\_framework::standalone\_activity\_service::IStandaloneActivityCreator::Create  ( \[\[maybe\_unused\] \] const core::scheduling::StandaloneInitData &amp;  *standalone\_init\_data*)   pure virtual 

Create an IActivityPtr which will be scheduled remotely through scheduling event.

Parameters standalone\_init\_dataThe class contains inputs required for this Standalone Activity. The StandaloneActivityCreator is responsible to decode this properly and use the inputs data for initialization of Activity ReturnsA pointer of IActivity interface which will be controlled remotely by simfwk core 



<a id="a1534824e56569105e521cbb28d62363c"></a>## [◆ ](#a1534824e56569105e521cbb28d62363c)GetName()

 virtual std::string simulation\_framework::standalone\_activity\_service::IStandaloneActivityCreator::GetName  ( )   pure virtual 

Returnsthe name of this standalone activity 



---

The documentation for this class was generated from the following file:- [i\_standalone\_activity\_creator.h](i__standalone__activity__creator_8h_source.xhtml)