@@ -251,6 +251,16 @@ func buildDynamicPythonImplementation(componentdefinition ComponentDefinition, w
251
251
w .Writeln ("" )
252
252
}
253
253
254
+ w .Writeln ("" )
255
+ w .Writeln ("'''Extended handle type" )
256
+ w .Writeln ("'''" )
257
+ w .Writeln ("class %sExtendedHandle(ctypes.Structure):" , NameSpace )
258
+ w .Writeln (" _pack_ = 1" )
259
+ w .Writeln (" _fields_ = [" )
260
+ w .Writeln (" ('handle', ctypes.c_void_p)" )
261
+ w .Writeln (" ('symbolLookupMethod', ctypes.c_void_p)" )
262
+
263
+
254
264
w .Writeln ("" )
255
265
w .Writeln ("'''Wrapper Class Implementation" )
256
266
w .Writeln ("'''" )
@@ -504,6 +514,10 @@ func loadFunctionTable(componentdefinition ComponentDefinition, w LanguageWriter
504
514
return nil
505
515
}
506
516
517
+ func getExtendedHandleName (NameSpace string , ParamClass string )(string ) {
518
+ return ParamClass + "ExtendedHandle" ;
519
+ }
520
+
507
521
func getCTypesParameterTypeName (ParamTypeName string , NameSpace string , ParamClass string , isPlain bool )(string , error ) {
508
522
CTypesParamTypeName := "" ;
509
523
switch (ParamTypeName ) {
@@ -548,7 +562,7 @@ func getCTypesParameterTypeName(ParamTypeName string, NameSpace string, ParamCla
548
562
case "functiontype" :
549
563
return fmt .Sprintf ("%s" , ParamClass ), nil
550
564
case "class" , "optionalclass" :
551
- CTypesParamTypeName = "ctypes.c_void_p" ;
565
+ CTypesParamTypeName = getExtendedHandleName ( ParamClass , NameSpace ) ;
552
566
default :
553
567
return "" , fmt .Errorf ("invalid parameter type \" %s\" for Python parameter" , ParamTypeName );
554
568
}
0 commit comments