Skip to content

Commit

Permalink
Refs #19451.- Fix externals
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Mar 11, 2024
1 parent 033d606 commit 429ab9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/main/java/com/eprosima/fastcdr/idl/templates/TypesHeader.stg
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public:
private:

$union.members: { member |
$member.typecode.cppTypename$& $member.name$_()
$member_type_declaration(member)$& $member.name$_()
{
if ($member.id$ != selected_member_)
{
Expand All @@ -505,7 +505,7 @@ private:
m_$member.name$ = $member_default_init(member)$;
$else$
member_destructor_ = [&]() {$union_member_destroy_call(member)$\};
new(&m_$member.name$) $member.typecode.cppTypename$();
new(&m_$member.name$) $member_type_declaration(member)$();
$endif$;
\}

Expand Down Expand Up @@ -965,16 +965,19 @@ $member_type_declaration(member)$ m_$member.name$;
>>

union_member_destroy_call(member) ::= <%
$if(!member.typecode.isAliasType && (member.typecode.isStringType || member.typecode.isWStringType))$
m_$member.name$.~basic_string();
m_$member.name$.
$if(member.annotationExternal)$
~external();
$elseif(!member.typecode.isAliasType && (member.typecode.isStringType || member.typecode.isWStringType))$
~basic_string();
$elseif(!member.typecode.isAliasType && member.typecode.isSequenceType)$
m_$member.name$.~vector();
~vector();
$elseif(!member.typecode.isAliasType && member.typecode.isArrayType)$
m_$member.name$.~array();
~array();
$elseif(!member.typecode.isAliasType && member.typecode.isMapType)$
m_$member.name$.~map();
~map();
$else$
m_$member.name$.~$member.typecode.noScopedCppTypename$();
~$member.typecode.noScopedCppTypename$();
$endif$
%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
group TypesCdrAuxHeader;

import "eprosima.stg"
import "com/eprosima/fastcdr/idl/templates/FastCdrCommon.stg"

main(ctx, definitions, extensions) ::= <<
$fileHeader(ctx=ctx, file=[ctx.filename, "CdrAux.ipp"], description=["This source file contains some declarations of CDR related functions."])$
Expand Down Expand Up @@ -332,7 +333,7 @@ eProsima_user_DllExport void deserialize(
$member.labels:{ label |case $label$:}; separator="\n"$
$if(member.default)$default:$endif$
{
$member.typecode.cppTypename$ $member.name$_value;
$member_type_declaration(member)$ $member.name$_value;
data.$member.name$(std::move($member.name$_value));
data._d(discriminator);
break;
Expand Down

0 comments on commit 429ab9c

Please sign in to comment.