@@ -53,6 +53,7 @@ def __init__(self,
5353 'Matrix' : 'double' ,
5454 'int' : 'numeric' ,
5555 'size_t' : 'numeric' ,
56+ 'Key' : 'numeric' ,
5657 'bool' : 'logical'
5758 }
5859 # Map the data type into the type used in Matlab methods.
@@ -68,6 +69,7 @@ def __init__(self,
6869 'Point3' : 'double' ,
6970 'Vector' : 'double' ,
7071 'Matrix' : 'double' ,
72+ 'Key' : 'numeric' ,
7173 'bool' : 'bool'
7274 }
7375 # The amount of times the wrapper has created a call to geometry_wrapper
@@ -108,7 +110,8 @@ def _update_wrapper_id(self,
108110
109111 Args:
110112 collector_function: tuple storing info about the wrapper function
111- (namespace, class instance, function name, function object)
113+ (namespace, class/function instance,
114+ type of collector function, method object if class instance)
112115 id_diff: constant to add to the id in the map
113116 function_name: Optional custom function_name.
114117
@@ -372,9 +375,9 @@ def _unwrap_argument(self, arg, arg_id=0, instantiated_class=None):
372375 ctype_sep = ctype_sep , ctype = ctype_camel , id = arg_id )
373376
374377 else :
375- arg_type = "{ctype}" .format (ctype = arg .ctype .typename . name )
378+ arg_type = "{ctype}" .format (ctype = self . _format_type_name ( arg .ctype .typename ) )
376379 unwrap = 'unwrap< {ctype} >(in[{id}]);' .format (
377- ctype = arg .ctype .typename . name , id = arg_id )
380+ ctype = self . _format_type_name ( arg .ctype .typename ) , id = arg_id )
378381
379382 return arg_type , unwrap
380383
@@ -578,6 +581,7 @@ def wrap_global_function(self, function):
578581 # Get all combinations of parameters
579582 param_wrap = ''
580583
584+ # Iterate through possible overloads of the function
581585 for i , overload in enumerate (function ):
582586 param_wrap += ' if' if i == 0 else ' elseif'
583587 param_wrap += ' length(varargin) == '
@@ -1218,7 +1222,7 @@ def wrap_namespace(self, namespace, add_mex_file=True):
12181222 if isinstance (func , parser .GlobalFunction )
12191223 ]
12201224
1221- self .wrap_methods (all_funcs , True , global_ns = namespace )
1225+ self .wrap_methods (all_funcs , global_funcs = True , global_ns = namespace )
12221226
12231227 return wrapped
12241228
@@ -1333,7 +1337,7 @@ def _collector_return(self,
13331337 prefix = ' ' )
13341338 else :
13351339 expanded += ' out[0] = wrap< {0} >({1});' .format (
1336- ctype .typename . name , obj )
1340+ self . _format_type_name ( ctype .typename ) , obj )
13371341
13381342 return expanded
13391343
@@ -1365,8 +1369,8 @@ def wrap_collector_function_return(self, method, instantiated_class=None):
13651369 method_name += method .original .name
13661370
13671371 elif isinstance (method , parser .GlobalFunction ):
1368- method_name = self ._format_global_function (method , '::' )
1369- method_name += method .name
1372+ namespace = self ._format_global_function (method , '::' )
1373+ method_name = namespace + method .to_cpp ()
13701374
13711375 else :
13721376 if isinstance (method .parent , instantiator .InstantiatedClass ):
@@ -1624,7 +1628,7 @@ def generate_collector_function(self, func_id):
16241628
16251629 body += self ._wrapper_unwrap_arguments (collector_func [1 ].args )[1 ]
16261630 body += self .wrap_collector_function_return (
1627- collector_func [1 ]) + ' \n }\n '
1631+ collector_func [1 ]) + " \n }\n "
16281632
16291633 collector_function += body
16301634
0 commit comments