mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
Add namespaces and proper support of the pointers
This commit is contained in:
parent
35d0a45df6
commit
723b42e0da
@ -795,7 +795,7 @@ class ClassInfo(GeneralInfo):
|
|||||||
self.base = re.sub(r"^.*:", "", decl[1].split(",")[0]).strip().replace(self.jname, "")
|
self.base = re.sub(r"^.*:", "", decl[1].split(",")[0]).strip().replace(self.jname, "")
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return Template("CLASS $namespace.$classpath.$name : $base").substitute(**self.__dict__)
|
return Template("CLASS $namespace::$classpath.$name : $base").substitute(**self.__dict__)
|
||||||
|
|
||||||
def getAllImports(self, module):
|
def getAllImports(self, module):
|
||||||
return ["import %s;" % c for c in sorted(self.imports) if not c.startswith('org.opencv.'+module)]
|
return ["import %s;" % c for c in sorted(self.imports) if not c.startswith('org.opencv.'+module)]
|
||||||
@ -1406,6 +1406,8 @@ class JavaWrapperGenerator(object):
|
|||||||
clazz = ci.jname
|
clazz = ci.jname
|
||||||
cpp_code.write ( Template( \
|
cpp_code.write ( Template( \
|
||||||
"""
|
"""
|
||||||
|
${namespace}
|
||||||
|
|
||||||
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ($argst);
|
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ($argst);
|
||||||
|
|
||||||
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
|
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
|
||||||
@ -1440,6 +1442,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
|
|||||||
cvargs = ", ".join(cvargs), \
|
cvargs = ", ".join(cvargs), \
|
||||||
default = default, \
|
default = default, \
|
||||||
retval = retval, \
|
retval = retval, \
|
||||||
|
namespace = ('using namespace ' + ci.namespace.replace('.', '::') + ';') if ci.namespace else ''
|
||||||
) )
|
) )
|
||||||
|
|
||||||
# processing args with default values
|
# processing args with default values
|
||||||
@ -1535,7 +1538,7 @@ JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete
|
|||||||
'''
|
'''
|
||||||
Check if class stores Ptr<T>* instead of T* in nativeObj field
|
Check if class stores Ptr<T>* instead of T* in nativeObj field
|
||||||
'''
|
'''
|
||||||
return self.isWrapped(classname) and self.classes[classname].base
|
return False
|
||||||
|
|
||||||
def smartWrap(self, name, fullname):
|
def smartWrap(self, name, fullname):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user