From a7d81dff70e39a61a5921c155ae118572f2a67c7 Mon Sep 17 00:00:00 2001 From: yibowen Date: Wed, 3 Sep 2025 15:25:33 +0800 Subject: [PATCH] fix(idlgen): fix idlgen example parameter error Issues: ICV41T --- .../com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain.stg | 5 +++++ .../eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain2to2.stg | 5 +++++ .../eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource.stg | 4 ---- .../vbsdds/idl/templates/cpp/DDSPublisherSource2to2.stg | 4 ---- .../vbsdds/idl/templates/cpp/DDSPublisherSourceZeroCopy.stg | 4 ---- .../vbsdds/idl/templates/cpp/DDSSubscriberSource.stg | 4 ---- .../vbsdds/idl/templates/cpp/DDSSubscriberSource2to2.stg | 4 ---- .../vbsdds/idl/templates/cpp/DDSSubscriberSourceZeroCopy.stg | 4 ---- 8 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain.stg index d8dcc82..d1a8af3 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain.stg @@ -121,6 +121,11 @@ $if(ctx.NotUseVbsFramework)$ { xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); } +$else$ + if (argc == 3) + { + xml_config_file = argv[2]; + } $endif$ // Register the type being used diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain2to2.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain2to2.stg index b6cd7c8..b140ed5 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain2to2.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPubSubMain2to2.stg @@ -63,6 +63,11 @@ $if(ctx.NotUseVbsFramework)$ { xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); } +$else$ + if (argc == 3) + { + xml_config_file = argv[2]; + } $endif$ // Register the type being used diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource.stg index 8448cf2..a010fcd 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource.stg @@ -99,11 +99,7 @@ bool $ctx.filename$Publisher::init(const std::string& xml_config_file) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_pub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource2to2.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource2to2.stg index 74480bc..3b5451f 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource2to2.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSource2to2.stg @@ -107,11 +107,7 @@ bool $ctx.filename$Publisher::init(bool use_env) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_pub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSourceZeroCopy.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSourceZeroCopy.stg index 8437189..b4a6175 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSourceZeroCopy.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSPublisherSourceZeroCopy.stg @@ -99,11 +99,7 @@ bool $ctx.filename$Publisher::init(bool use_env) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_pub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource.stg index 080cd4b..cc3e7ff 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource.stg @@ -117,11 +117,7 @@ bool $ctx.filename$Subscriber::init(const std::string& xml_config_file) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_sub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource2to2.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource2to2.stg index 395516f..34691af 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource2to2.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSource2to2.stg @@ -100,11 +100,7 @@ bool $ctx.filename$Subscriber::init(bool use_env) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_sub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ diff --git a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSourceZeroCopy.stg b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSourceZeroCopy.stg index 510ea73..5c7144a 100644 --- a/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSourceZeroCopy.stg +++ b/src/main/java/com/eprosima/vbsdds/idl/templates/cpp/DDSSubscriberSourceZeroCopy.stg @@ -94,11 +94,7 @@ bool $ctx.filename$Subscriber::init(bool use_env) $endif$ /* Create DomainParticipant*/ -$if(ctx.TestExample)$ std::string participant_profile_name = "test_xml_sub.xml_profile"; -$else$ - std::string participant_profile_name = "pub_participant_profile"; -$endif$ $if(ctx.UseVbsFramework)$ $if(ctx.TestExample)$ -- Gitee