Wrap ANN_MLP class into Python

This commit is contained in:
Maksim Shabunin
2015-05-06 15:21:23 +03:00
parent 4bf6bd3d37
commit c137ba53a0
3 changed files with 35 additions and 26 deletions

View File

@@ -393,7 +393,7 @@ class FuncVariant(object):
self.name = self.wname = name
self.isconstructor = isconstructor
self.rettype = handle_ptr(decl[1])
self.rettype = decl[4] if len(decl) >=5 else handle_ptr(decl[1])
if self.rettype == "void":
self.rettype = ""
self.args = []

View File

@@ -445,6 +445,12 @@ class CppHeaderParser(object):
rettype, funcname, modlist, argno = self.parse_arg(decl_start, -1)
# determine original return type, hack for return types with underscore
original_type = None
i = decl_start.rfind(funcname)
if i > 0:
original_type = decl_start[:i].replace("&", "").replace("const", "").strip()
if argno >= 0:
classname = top[1]
if rettype == classname or rettype == "~" + classname:
@@ -560,7 +566,10 @@ class CppHeaderParser(object):
if static_method:
func_modlist.append("/S")
return [funcname, rettype, func_modlist, args]
if original_type is None:
return [funcname, rettype, func_modlist, args]
else:
return [funcname, rettype, func_modlist, args, original_type]
def get_dotted_name(self, name):
"""