Skip to content

Commit

Permalink
Fix bounded collections with unbounded elements (#295)
Browse files Browse the repository at this point in the history
* Refs #20335: fix bounded collections with unbounded elements

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>

* Refs #20335: update submodules

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>

---------

Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>
  • Loading branch information
JLBuenoLopez committed Feb 26, 2024
1 parent 165cbad commit 4e7f30f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ $plain_collection_header(type=sequence.contentTypeCode, message="Sequence elemen
std::string type_id_kind_$sequence_name(sequence)$("$sequence.typeIdentifier$");
if (type_id_kind_$sequence_name(sequence)$ == "TI_PLAIN_SEQUENCE_SMALL")
{
SBound bound = $if (!sequence.isBounded)$0$else$static_cast<SBound>($sequence.evaluatedMaxsize$)$endif$;
SBound bound = $if (sequence.unbound)$0$else$static_cast<SBound>($sequence.evaluatedMaxsize$)$endif$;
PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_$sequence_name(sequence)$, bound,
eprosima::fastcdr::external<TypeIdentifier>(element_identifier_$sequence_name(sequence)$));
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
Expand Down Expand Up @@ -692,7 +692,7 @@ PlainCollectionHeader header_$map_name(map)$ = TypeObjectUtils::build_plain_coll
std::string type_id_kind_$map_name(map)$("$map.typeIdentifier$");
if (type_id_kind_$map_name(map)$ == "TI_PLAIN_MAP_SMALL")
{
SBound bound = $if (!map.isBounded)$0$else$static_cast<SBound>($map.evaluatedMaxsize$)$endif$;
SBound bound = $if (map.unbound)$0$else$static_cast<SBound>($map.evaluatedMaxsize$)$endif$;
PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_$map_name(map)$, bound,
eprosima::fastcdr::external<TypeIdentifier>(element_identifier_$map_name(map)$), key_flags_$map_name(map)$,
eprosima::fastcdr::external<TypeIdentifier>(key_identifier_$map_name(map)$));
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/com/eprosima/fastdds/idl/templates/eprosima.stg
Original file line number Diff line number Diff line change
Expand Up @@ -163,49 +163,49 @@ $endif$

map_name(map) ::= <%
$if(map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.primitive && !map.valueTypeCode.isEnumType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map.valueTypeCode.cppTypenameForTypeId$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map.valueTypeCode.cppTypenameForTypeId$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.isStringType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$string_name(string=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$string_name(string=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.isWStringType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$wstring_name(wstring=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$wstring_name(wstring=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.isArrayType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$array_name(array=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$array_name(array=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.isSequenceType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$sequence_name(sequence=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$sequence_name(sequence=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType && map.valueTypeCode.isMapType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map_name(map=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map_name(map=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.primitive && !map.keyTypeCode.isEnumType)$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map.valueTypeCode.CScopedname$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.cppTypenameForTypeId$_$map.valueTypeCode.CScopedname$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif(map.keyTypeCode.isStringType && map.valueTypeCode.primitive && !map.valueTypeCode.isEnumType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map.valueTypeCode.cppTypenameForTypeId$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map.valueTypeCode.cppTypenameForTypeId$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType && map.valueTypeCode.isStringType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$string_name(string=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$string_name(string=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType && map.valueTypeCode.isWStringType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$wstring_name(wstring=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$wstring_name(wstring=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType && map.valueTypeCode.isArrayType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$array_name(array=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$array_name(array=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType && map.valueTypeCode.isSequenceType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$sequence_name(sequence=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$sequence_name(sequence=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType && map.valueTypeCode.isMapType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map_name(map=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map_name(map=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isStringType)$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map.valueTypeCode.CScopedname$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$string_name(string=map.keyTypeCode)$_$map.valueTypeCode.CScopedname$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif(map.keyTypeCode.isWStringType && map.valueTypeCode.primitive && !map.valueTypeCode.isEnumType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map.valueTypeCode.cppTypenameForTypeId$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map.valueTypeCode.cppTypenameForTypeId$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType && map.valueTypeCode.isStringType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$string_name(string=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$string_name(string=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType && map.valueTypeCode.isWStringType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$wstring_name(wstring=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$wstring_name(wstring=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType && map.valueTypeCode.isArrayType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$array_name(array=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$array_name(array=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType && map.valueTypeCode.isSequenceType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$sequence_name(sequence=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$sequence_name(sequence=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType && map.valueTypeCode.isMapType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map_name(map=map.valueTypeCode)$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map_name(map=map.valueTypeCode)$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$elseif (map.keyTypeCode.isWStringType)$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map.valueTypeCode.CScopedname$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$wstring_name(wstring=map.keyTypeCode)$_$map.valueTypeCode.CScopedname$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$else$
anonymous_map_$map.keyTypeCode.CScopedname$_$map.valueTypeCode.CScopedname$_$if(map.isBounded)$$map.evaluatedMaxsize$$else$unbounded$endif$
anonymous_map_$map.keyTypeCode.CScopedname$_$map.valueTypeCode.CScopedname$_$if(!map.unbound)$$map.evaluatedMaxsize$$else$unbounded$endif$
$endif$
%>

Expand Down

0 comments on commit 4e7f30f

Please sign in to comment.