Skip to content

Commit

Permalink
Refs #18910: Correctly register type object with ROS 2 names
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Ponz <[email protected]>
  • Loading branch information
EduPonz committed Jun 23, 2023
1 parent 4e246f2 commit c6169b0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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$"$object.scopedname$"$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$"$object.scopedname$"$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$"$object.scopedname$"$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$"$object.scopedname$"$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$"$object.scopedname$"$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)$
{
Expand Down

0 comments on commit c6169b0

Please sign in to comment.