MCPcopy Create free account
hub / github.com/Autodesk/AutomaticComponentToolkit / getMethodCParams

Function getMethodCParams

Source/buildbindingpython.go:436–456  ·  view source on GitHub ↗
(method ComponentDefinitionMethod, NameSpace string, ClassName string, isGlobal bool)

Source from the content-addressed store, hash-verified

434}
435
436func getMethodCParams(method ComponentDefinitionMethod, NameSpace string, ClassName string, isGlobal bool) (string, error) {
437 parameters := ""
438 if (!isGlobal) {
439 parameters = "ctypes.c_void_p"
440 }
441 for k:=0; k<len(method.Params); k++ {
442 param := method.Params[k]
443 cparams, err := generateCTypesParameter(param, ClassName, method.MethodName, NameSpace)
444 if (err != nil) {
445 return "", err
446 }
447 for _, cparam := range cparams {
448 if (parameters != "") {
449 parameters = parameters + ", ";
450 }
451 parameters = parameters + cparam.ParamType
452 }
453 }
454
455 return parameters, nil
456}
457
458func loadFunctionTableFromMethod(componentdefinition ComponentDefinition, w LanguageWriter) error {
459 w.Writeln("symbolLookupMethodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p))")

Callers 2

writeFunctionTableMethodFunction · 0.85

Calls 1

generateCTypesParameterFunction · 0.85

Tested by

no test coverage detected