-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alexey-pelykh-cpp11_strongly_typed_enums__direct_inject…
…_in_java' * alexey-pelykh-cpp11_strongly_typed_enums__direct_inject_in_java: Enhance cpp11_strongly_typed_enumerations testcase and turn it on Simplify/improve strongly typed enum implementation for Java Rewrite some Java director nested class support code for strongly typed enums Expand director_nested_class test to test more than one level of nesting Add director_nested_class testcase Removed useless code (it does not affect output, at least on our testcases) Java/Fix: swig_connect_director used not-fully-qualified classname (proper) Java/Fix: swig_connect_director used not-fully-qualified classname Java: fix generation of ProxyName when JNI descriptor is requested - for inner classes '$' should be used as separator instead of '/' Java: fix invalid director 'self' variable type name (wasn't fully qualified) Clean-up test suite and fix issue with nspace, as well as keep the fix for Class::Struct::EnumClass being JNI-referenced as Struct_EnumClass C++11 strongly-typed enums fix for Java only (proper) Revert "C++11 strongly-typed enums fix for Java only" Additional test cases for C++11 strongly-typed enums C++11 strongly-typed enums fix for Java only
- Loading branch information
Showing
7 changed files
with
245 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
%module(directors="1") director_nested_class | ||
|
||
|
||
%feature("director") DirectorOuter::DirectorInner; | ||
%feature("director") DirectorOuter::DirectorInner::DirectorInnerInner; | ||
|
||
%inline %{ | ||
struct DirectorOuter { | ||
struct DirectorInner { | ||
virtual ~DirectorInner() {} | ||
virtual int vmethod(int input) const = 0; | ||
struct DirectorInnerInner { | ||
DirectorInnerInner(DirectorInner *din = 0) {} | ||
virtual ~DirectorInnerInner() {} | ||
virtual int innervmethod(int input) const = 0; | ||
}; | ||
}; | ||
static int callMethod(const DirectorInner &di, int value) { | ||
return di.vmethod(value); | ||
} | ||
static int callInnerInnerMethod(const DirectorInner::DirectorInnerInner &di, int value) { | ||
return di.innervmethod(value); | ||
} | ||
}; | ||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
import director_nested_class.*; | ||
|
||
public class director_nested_class_runme { | ||
|
||
static { | ||
try { | ||
System.loadLibrary("director_nested_class"); | ||
} catch (UnsatisfiedLinkError e) { | ||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
public static void main(String argv[]) { | ||
|
||
director_nested_class_Derived d = new director_nested_class_Derived(); | ||
|
||
if (DirectorOuter.callMethod(d, 999) != 9990) { | ||
throw new RuntimeException("callMethod(999) failed"); | ||
} | ||
|
||
director_nested_class_DerivedInnerInner dinner = new director_nested_class_DerivedInnerInner(); | ||
|
||
if (DirectorOuter.callInnerInnerMethod(dinner, 999) != 999000) { | ||
throw new RuntimeException("callMethod(999) failed"); | ||
} | ||
} | ||
} | ||
|
||
class director_nested_class_Derived extends DirectorOuter.DirectorInner { | ||
public int vmethod(int input) { | ||
return input * 10; | ||
} | ||
} | ||
|
||
class director_nested_class_DerivedInnerInner extends DirectorOuter.DirectorInner.DirectorInnerInner { | ||
public int innervmethod(int input) { | ||
return input * 1000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.