Skip to main content

AVxcelerate Simulation Framework 2024 R1

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...

#include <i_standalone_activity_creator.h>

Public Member Functions

virtual std::string GetName ()=0
 
virtual core::lifecycle::IActivityPtr Create ([[maybe_unused]] const core::scheduling::StandaloneInitData &standalone_init_data)=0
 Create an IActivityPtr which will be scheduled remotely through scheduling event. More...
 

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

This example shows how to implement the IStandaloneActivityCreator interface based on "MyActivity"

using TopicToBePublished = Topic<MsgToBePublished>;
using TopicSubscribingOn = Topic<MsgSubscribingOn>;
class MyActivityCreator : public IStandaloneActivityCreator
{
public:
MyActivityCreator(const std::string& name) : standalone_activity_name_(name) {}
IActivityPtr Create(const core::scheduling::StandaloneInitData& standalone_init_data) override
{
TopicPtr topic_going_to_publish = std::make_shared<TopicToBePublished>("TopicToBePublished");
TopicPtr topic_want_to_receive = std::make_shared<TopicSubscribingOn>("TopicSubscribingOn");
return std::make_unique<MyActivity>(
standalone_activity_name_, Topics{topic_going_to_publish, topic_want_to_receive}, MyLogic{});
}
std::string GetName() override { return standalone_activity_name_; }
private:
std::string standalone_activity_name_;
};

Member Function Documentation

◆ Create()

virtual core::lifecycle::IActivityPtr simulation_framework::standalone_activity_service::IStandaloneActivityCreator::Create ( [[maybe_unused] ] const core::scheduling::StandaloneInitData &  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
Returns
A pointer of IActivity interface which will be controlled remotely by simfwk core

◆ GetName()

virtual std::string simulation_framework::standalone_activity_service::IStandaloneActivityCreator::GetName ( )
pure virtual
Returns
the name of this standalone activity

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

Connect with Ansys