From 09149b1610b08e8a5add959aad62e20186038a82 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Fri, 23 Jun 2023 12:24:13 +0200 Subject: [PATCH] Correctly register type object with ROS 2 names (#195) * Refs #18910: Correctly register type object with ROS 2 names Signed-off-by: Eduardo Ponz * Refs #18910: Apply suggestions Signed-off-by: Eduardo Ponz --------- Signed-off-by: Eduardo Ponz --- .../fastcdr/idl/templates/TypeObjectSource.stg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/eprosima/fastcdr/idl/templates/TypeObjectSource.stg b/src/main/java/com/eprosima/fastcdr/idl/templates/TypeObjectSource.stg index be176b82..7bc8cd01 100644 --- a/src/main/java/com/eprosima/fastcdr/idl/templates/TypeObjectSource.stg +++ b/src/main/java/com/eprosima/fastcdr/idl/templates/TypeObjectSource.stg @@ -59,23 +59,23 @@ $definitions; separator="\n"$ try_create(ctx, object, param) ::= << -if ($param$ == "$if(object.hasScope)$$object.scope$::$endif$$object.name$") return $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(complete); +if ($param$ == $if(ctx.GenerateTypesROS2)$"$object.ROS2Scopedname$"$else$"$if(object.hasScope)$$object.scope$::$endif$$object.name$"$endif$) return $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(complete); >> try_object(ctx, object, param) ::= << -if ($param$ == "$if(object.hasScope)$$object.scope$::$endif$$object.name$") +if ($param$ == $if(ctx.GenerateTypesROS2)$"$object.ROS2Scopedname$"$else$"$if(object.hasScope)$$object.scope$::$endif$$object.name$"$endif$) { $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(complete); - return TypeObjectFactory::get_instance()->get_type_object("$if(object.hasScope)$$object.scope$::$endif$$object.name$", complete); + return TypeObjectFactory::get_instance()->get_type_object($if(ctx.GenerateTypesROS2)$"$object.ROS2Scopedname$"$else$"$if(object.hasScope)$$object.scope$::$endif$$object.name$"$endif$, complete); } >> register_type(ctx, object, param) ::= << $if(!object.isModule)$ $if(!object.isConstDeclaration)$ -factory->add_type_object("$if(object.hasScope)$$object.scope$::$endif$$object.name$", $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(true), +factory->add_type_object($if(ctx.GenerateTypesROS2)$"$object.ROS2Scopedname$"$else$"$if(object.hasScope)$$object.scope$::$endif$$object.name$"$endif$, $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(true), $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Object(true)); -factory->add_type_object("$if(object.hasScope)$$object.scope$::$endif$$object.name$", $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(false), +factory->add_type_object($if(ctx.GenerateTypesROS2)$"$object.ROS2Scopedname$"$else$"$if(object.hasScope)$$object.scope$::$endif$$object.name$"$endif$, $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Identifier(false), $if(object.hasScope)$$object.scope$::$endif$Get$object.name$Object(false)); $if(object.isAnnotation)$ {