Skip to content

Commit

Permalink
Merge pull request #541 from borglab/wrap-update
Browse files Browse the repository at this point in the history
Wrap update
  • Loading branch information
varunagrawal authored Sep 26, 2020
2 parents 79d6d5f + aa173ac commit 23547c7
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions wrap/matlab_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,26 @@ def _format_type_name(cls, type_name, separator='::', include_namespace=True, co
else:
formatted_type_name += name

if len(type_name.instantiations) == 1:
if separator == "::": # C++
formatted_type_name += '<{}>'.format(cls._format_type_name(type_name.instantiations[0],
include_namespace=include_namespace,
constructor=constructor, method=method))
else:
if separator == "::": # C++
templates = []
for idx in range(len(type_name.instantiations)):
template = '{}'.format(cls._format_type_name(type_name.instantiations[idx],
include_namespace=include_namespace,
constructor=constructor, method=method))
templates.append(template)

if len(templates) > 0: # If there are no templates
formatted_type_name += '<{}>'.format(','.join(templates))

else:
for idx in range(len(type_name.instantiations)):
formatted_type_name += '{}'.format(cls._format_type_name(
type_name.instantiations[0],
type_name.instantiations[idx],
separator=separator,
include_namespace=False,
constructor=constructor, method=method
))

return formatted_type_name

@classmethod
Expand Down

0 comments on commit 23547c7

Please sign in to comment.