Skip to content

Commit

Permalink
Correctly register type object with ROS 2 names (#195)
Browse files Browse the repository at this point in the history
* Refs #18910: Correctly register type object with ROS 2 names

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #18910: Apply suggestions

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

---------

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Jun 23, 2023
1 parent 4682655 commit 09149b1
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$"$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)$
{
Expand Down

0 comments on commit 09149b1

Please sign in to comment.