From f79a1fb2b32de40fd07f5a9c11f96b2a721f6e41 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 25 Sep 2020 20:59:12 -0400 Subject: [PATCH] Squashed 'wrap/' changes from 314b121fd..5e1373486 5e1373486 Merge pull request #7 from varunagrawal/fix/matlab-wrapper-templates db647232d support for This with multiple templates git-subtree-dir: wrap git-subtree-split: 5e1373486d5d9ba0827aab20ca3ea1083e24b3da --- matlab_wrapper.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/matlab_wrapper.py b/matlab_wrapper.py index 23f56c8b0..1b6b75a49 100755 --- a/matlab_wrapper.py +++ b/matlab_wrapper.py @@ -210,18 +210,26 @@ class MatlabWrapper(object): 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