diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 902765468..e6c4a65cc 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -219,6 +219,10 @@ CPP_TEST_CASES += \ refcount \ reference_global_vars \ register_par \ + rename1 \ + rename2 \ + rename3 \ + rename4 \ rename_scope \ restrict_cplusplus \ return_const_value \ diff --git a/Examples/test-suite/conversion_namespace.i b/Examples/test-suite/conversion_namespace.i index 70d4b9ebc..e090025a3 100644 --- a/Examples/test-suite/conversion_namespace.i +++ b/Examples/test-suite/conversion_namespace.i @@ -1,5 +1,5 @@ %module conversion_namespace -%rename(toFoo) oss::Bar::operator oss::Foo(); +%rename(toFoo) oss::Bar::operator Foo(); %inline %{ namespace oss diff --git a/Examples/test-suite/java/rename1_runme.java b/Examples/test-suite/java/rename1_runme.java new file mode 100644 index 000000000..058de41fd --- /dev/null +++ b/Examples/test-suite/java/rename1_runme.java @@ -0,0 +1,75 @@ + +import rename1.*; + +public class rename1_runme { + + static { + try { + System.loadLibrary("rename1"); + } 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); + } + } + + // The code in main is the same for rename1_runme, rename2_runme, rename3_runme and renam4_runme + public static void main(String argv[]) { + { + XYZInt xyz = new XYZInt(); + NotXYZInt notxyz = new NotXYZInt(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother2(); + xyz.opT2(); + xyz.tMethod2(0); + xyz.tMethodNotXYZ2(notxyz); + xyz.opNotXYZ2(); + xyz.opXYZ2(); + } + { + XYZDouble xyz = new XYZDouble(); + NotXYZDouble notxyz = new NotXYZDouble(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother1(); + xyz.opT1(); + xyz.tMethod1(0); + xyz.tMethodNotXYZ1(notxyz); + xyz.opNotXYZ1(); + xyz.opXYZ1(); + } + { + XYZKlass xyz = new XYZKlass(); + NotXYZKlass notxyz = new NotXYZKlass(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother3(); + xyz.opT3(); + xyz.tMethod3(new Klass()); + xyz.tMethodNotXYZ3(notxyz); + xyz.opNotXYZ3(); + xyz.opXYZ3(); + } + { + XYZEnu xyz = new XYZEnu(); + NotXYZEnu notxyz = new NotXYZEnu(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother4(); + xyz.opT4(); + xyz.tMethod4(Enu.En1); + xyz.tMethodNotXYZ4(notxyz); + xyz.opNotXYZ4(); + xyz.opXYZ4(); + } + { + ABC abc = new ABC(); + abc.methodABC(abc); + Klass k = new Klass(); + abc.methodKlass(k); + ABC a = abc.opABC(); + k = abc.opKlass(); + } + } +} + diff --git a/Examples/test-suite/java/rename2_runme.java b/Examples/test-suite/java/rename2_runme.java new file mode 100644 index 000000000..b6a62dd1e --- /dev/null +++ b/Examples/test-suite/java/rename2_runme.java @@ -0,0 +1,75 @@ + +import rename2.*; + +public class rename2_runme { + + static { + try { + System.loadLibrary("rename2"); + } 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); + } + } + + // The code in main is the same for rename1_runme, rename2_runme, rename3_runme and renam4_runme + public static void main(String argv[]) { + { + XYZInt xyz = new XYZInt(); + NotXYZInt notxyz = new NotXYZInt(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother2(); + xyz.opT2(); + xyz.tMethod2(0); + xyz.tMethodNotXYZ2(notxyz); + xyz.opNotXYZ2(); + xyz.opXYZ2(); + } + { + XYZDouble xyz = new XYZDouble(); + NotXYZDouble notxyz = new NotXYZDouble(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother1(); + xyz.opT1(); + xyz.tMethod1(0); + xyz.tMethodNotXYZ1(notxyz); + xyz.opNotXYZ1(); + xyz.opXYZ1(); + } + { + XYZKlass xyz = new XYZKlass(); + NotXYZKlass notxyz = new NotXYZKlass(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother3(); + xyz.opT3(); + xyz.tMethod3(new Klass()); + xyz.tMethodNotXYZ3(notxyz); + xyz.opNotXYZ3(); + xyz.opXYZ3(); + } + { + XYZEnu xyz = new XYZEnu(); + NotXYZEnu notxyz = new NotXYZEnu(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother4(); + xyz.opT4(); + xyz.tMethod4(Enu.En1); + xyz.tMethodNotXYZ4(notxyz); + xyz.opNotXYZ4(); + xyz.opXYZ4(); + } + { + ABC abc = new ABC(); + abc.methodABC(abc); + Klass k = new Klass(); + abc.methodKlass(k); + ABC a = abc.opABC(); + k = abc.opKlass(); + } + } +} + diff --git a/Examples/test-suite/java/rename3_runme.java b/Examples/test-suite/java/rename3_runme.java new file mode 100644 index 000000000..e1b090af8 --- /dev/null +++ b/Examples/test-suite/java/rename3_runme.java @@ -0,0 +1,75 @@ + +import rename3.*; + +public class rename3_runme { + + static { + try { + System.loadLibrary("rename3"); + } 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); + } + } + + // The code in main is the same for rename1_runme, rename2_runme, rename3_runme and renam4_runme + public static void main(String argv[]) { + { + XYZInt xyz = new XYZInt(); + NotXYZInt notxyz = new NotXYZInt(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother2(); + xyz.opT2(); + xyz.tMethod2(0); + xyz.tMethodNotXYZ2(notxyz); + xyz.opNotXYZ2(); + xyz.opXYZ2(); + } + { + XYZDouble xyz = new XYZDouble(); + NotXYZDouble notxyz = new NotXYZDouble(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother1(); + xyz.opT1(); + xyz.tMethod1(0); + xyz.tMethodNotXYZ1(notxyz); + xyz.opNotXYZ1(); + xyz.opXYZ1(); + } + { + XYZKlass xyz = new XYZKlass(); + NotXYZKlass notxyz = new NotXYZKlass(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother3(); + xyz.opT3(); + xyz.tMethod3(new Klass()); + xyz.tMethodNotXYZ3(notxyz); + xyz.opNotXYZ3(); + xyz.opXYZ3(); + } + { + XYZEnu xyz = new XYZEnu(); + NotXYZEnu notxyz = new NotXYZEnu(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother4(); + xyz.opT4(); + xyz.tMethod4(Enu.En1); + xyz.tMethodNotXYZ4(notxyz); + xyz.opNotXYZ4(); + xyz.opXYZ4(); + } + { + ABC abc = new ABC(); + abc.methodABC(abc); + Klass k = new Klass(); + abc.methodKlass(k); + ABC a = abc.opABC(); + k = abc.opKlass(); + } + } +} + diff --git a/Examples/test-suite/java/rename4_runme.java b/Examples/test-suite/java/rename4_runme.java new file mode 100644 index 000000000..69f909e9e --- /dev/null +++ b/Examples/test-suite/java/rename4_runme.java @@ -0,0 +1,75 @@ + +import rename4.*; + +public class rename4_runme { + + static { + try { + System.loadLibrary("rename4"); + } 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); + } + } + + // The code in main is the same for rename1_runme, rename2_runme, rename3_runme and renam4_runme + public static void main(String argv[]) { + { + XYZInt xyz = new XYZInt(); + NotXYZInt notxyz = new NotXYZInt(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother2(); + xyz.opT2(); + xyz.tMethod2(0); + xyz.tMethodNotXYZ2(notxyz); + xyz.opNotXYZ2(); + xyz.opXYZ2(); + } + { + XYZDouble xyz = new XYZDouble(); + NotXYZDouble notxyz = new NotXYZDouble(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother1(); + xyz.opT1(); + xyz.tMethod1(0); + xyz.tMethodNotXYZ1(notxyz); + xyz.opNotXYZ1(); + xyz.opXYZ1(); + } + { + XYZKlass xyz = new XYZKlass(); + NotXYZKlass notxyz = new NotXYZKlass(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother3(); + xyz.opT3(); + xyz.tMethod3(new Klass()); + xyz.tMethodNotXYZ3(notxyz); + xyz.opNotXYZ3(); + xyz.opXYZ3(); + } + { + XYZEnu xyz = new XYZEnu(); + NotXYZEnu notxyz = new NotXYZEnu(); + xyz.opIntPtrA(); + xyz.opIntPtrB(); + xyz.opAnother4(); + xyz.opT4(); + xyz.tMethod4(Enu.En1); + xyz.tMethodNotXYZ4(notxyz); + xyz.opNotXYZ4(); + xyz.opXYZ4(); + } + { + ABC abc = new ABC(); + abc.methodABC(abc); + Klass k = new Klass(); + abc.methodKlass(k); + ABC a = abc.opABC(); + k = abc.opKlass(); + } + } +} + diff --git a/Examples/test-suite/rename.h b/Examples/test-suite/rename.h new file mode 100644 index 000000000..7160539ed --- /dev/null +++ b/Examples/test-suite/rename.h @@ -0,0 +1,44 @@ + +namespace Space { +struct Klass { + Klass(int i) {} + Klass() {} +}; +} + +namespace AnotherSpace { + class Another {}; +} + +namespace Space { + using namespace AnotherSpace; + enum Enu { En1, En2, En3 }; + template struct NotXYZ {}; + template class XYZ { + NotXYZ *m_int; + T m_t; + NotXYZ m_notxyz; + public: + operator NotXYZ*() const { return m_int; } + operator XYZ*() const { return 0; } + operator Another() const { Another an; return an; } + void templateT(T i) {} + void templateNotXYZ(NotXYZ i) {} + void templateXYZ(XYZ i) {} + operator T() { return m_t; } + operator NotXYZ() const { return m_notxyz; } + operator XYZ() const { XYZ xyz; return xyz; } + }; +} + +namespace Space { +// non-templated class using itself in method and operator +class ABC { + public: + void method(ABC a) const {} + void method(Klass k) const {} + operator ABC() const { ABC a; return a; } + operator Klass() const { Klass k; return k; } +}; +} + diff --git a/Examples/test-suite/rename1.i b/Examples/test-suite/rename1.i new file mode 100644 index 000000000..38af2b3bd --- /dev/null +++ b/Examples/test-suite/rename1.i @@ -0,0 +1,63 @@ +// Test %rename directive in global namespace by fully qualifying types +%module rename1 + +// Note: Space:: qualifier +%rename(opIntPtrA) Space::XYZ::operator NotXYZ*() const; +%rename(opIntPtrB) Space::XYZ::operator XYZ*() const; + +%rename(opAnother1) Space::XYZ::operator Another() const; +%rename(opAnother2) Space::XYZ::operator Another() const; +%rename(opAnother3) Space::XYZ::operator Another() const; +%rename(opAnother4) Space::XYZ::operator Another() const; + +%rename(tMethod1) Space::XYZ::templateT(T i); +%rename(tMethod2) Space::XYZ::templateT(int i); +%rename(tMethod3) Space::XYZ::templateT(Space::Klass i); +%rename(tMethod4) Space::XYZ::templateT(Space::Enu i); + +%rename(tMethodNotXYZ1) Space::XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ2) Space::XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ3) Space::XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ4) Space::XYZ::templateNotXYZ(NotXYZ); + +%rename(tMethodXYZ1) Space::XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ2) Space::XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ3) Space::XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ4) Space::XYZ::templateXYZ(XYZ); + +%rename(opT1) Space::XYZ::operator T(); +%rename(opT2) Space::XYZ::operator int(); +%rename(opT3) Space::XYZ::operator Space::Klass(); +%rename(opT4) Space::XYZ::operator Space::Enu(); + +%rename(opNotXYZ1) Space::XYZ::operator NotXYZ() const; +%rename(opNotXYZ2) Space::XYZ::operator NotXYZ() const; +%rename(opNotXYZ3) Space::XYZ::operator NotXYZ() const; +%rename(opNotXYZ4) Space::XYZ::operator NotXYZ() const; + +%rename(opXYZ1) Space::XYZ::operator XYZ() const; +%rename(opXYZ2) Space::XYZ::operator XYZ() const; +%rename(opXYZ3) Space::XYZ::operator XYZ() const; +%rename(opXYZ4) Space::XYZ::operator XYZ() const; + + +%rename(methodABC) Space::ABC::method(ABC a) const; +%rename(opABC) Space::ABC::operator ABC() const; +%rename(methodKlass) Space::ABC::method(Klass k) const; +%rename(opKlass) Space::ABC::operator Klass() const; + +%{ +#include "rename.h" +%} +%include "rename.h" + +%template(XYZInt) Space::XYZ; +%template(XYZDouble) Space::XYZ; +%template(XYZKlass) Space::XYZ; +%template(XYZEnu) Space::XYZ; + +%template(NotXYZInt) Space::NotXYZ; +%template(NotXYZDouble) Space::NotXYZ; +%template(NotXYZKlass) Space::NotXYZ; +%template(NotXYZEnu) Space::NotXYZ; + diff --git a/Examples/test-suite/rename2.i b/Examples/test-suite/rename2.i new file mode 100644 index 000000000..6a9c22ecf --- /dev/null +++ b/Examples/test-suite/rename2.i @@ -0,0 +1,65 @@ +// Test %rename directive in the Space namespace +%module rename2 + +namespace Space { +// Note: no Space:: qualifier +%rename(opIntPtrA) XYZ::operator NotXYZ*() const; +%rename(opIntPtrB) XYZ::operator XYZ*() const; + +%rename(opAnother1) XYZ::operator Another() const; +%rename(opAnother2) XYZ::operator Another() const; +%rename(opAnother3) XYZ::operator Another() const; +%rename(opAnother4) XYZ::operator Another() const; + +%rename(tMethod1) XYZ::templateT(T i); +%rename(tMethod2) XYZ::templateT(int i); +%rename(tMethod3) XYZ::templateT(Space::Klass i); +%rename(tMethod4) XYZ::templateT(Space::Enu i); + +%rename(tMethodNotXYZ1) XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ2) XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ3) XYZ::templateNotXYZ(NotXYZ); +%rename(tMethodNotXYZ4) XYZ::templateNotXYZ(NotXYZ); + +%rename(tMethodXYZ1) XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ2) XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ3) XYZ::templateXYZ(XYZ); +%rename(tMethodXYZ4) XYZ::templateXYZ(XYZ); + +%rename(opT1) XYZ::operator T(); +%rename(opT2) XYZ::operator int(); +%rename(opT3) XYZ::operator Space::Klass(); +%rename(opT4) XYZ::operator Space::Enu(); + +%rename(opNotXYZ1) XYZ::operator NotXYZ() const; +%rename(opNotXYZ2) XYZ::operator NotXYZ() const; +%rename(opNotXYZ3) XYZ::operator NotXYZ() const; +%rename(opNotXYZ4) XYZ::operator NotXYZ() const; + +%rename(opXYZ1) XYZ::operator XYZ() const; +%rename(opXYZ2) XYZ::operator XYZ() const; +%rename(opXYZ3) XYZ::operator XYZ() const; +%rename(opXYZ4) XYZ::operator XYZ() const; + + +%rename(methodABC) ABC::method(ABC a) const; +%rename(opABC) ABC::operator ABC() const; +%rename(methodKlass) ABC::method(Klass k) const; +%rename(opKlass) ABC::operator Klass() const; +} + +%{ +#include "rename.h" +%} +%include "rename.h" + +%template(XYZInt) Space::XYZ; +%template(XYZDouble) Space::XYZ; +%template(XYZKlass) Space::XYZ; +%template(XYZEnu) Space::XYZ; + +%template(NotXYZInt) Space::NotXYZ; +%template(NotXYZDouble) Space::NotXYZ; +%template(NotXYZKlass) Space::NotXYZ; +%template(NotXYZEnu) Space::NotXYZ; + diff --git a/Examples/test-suite/rename3.i b/Examples/test-suite/rename3.i new file mode 100644 index 000000000..b39979fdd --- /dev/null +++ b/Examples/test-suite/rename3.i @@ -0,0 +1,75 @@ +// Test %rename directive within %extend +%module rename3 + +namespace Space { + // Note no namespace nor class qualification + %extend XYZ { + %rename(opIntPtrA) operator NotXYZ*() const; + %rename(opIntPtrB) operator XYZ*() const; + } + + %extend XYZ { + // Note use of type T + %rename(opAnother1) operator Another() const; + %rename(tMethod1) templateT(T i); + %rename(tMethodNotXYZ1) templateNotXYZ(NotXYZ); + %rename(tMethodXYZ1) templateXYZ(XYZ); + %rename(opT1) operator T(); + %rename(opNotXYZ1) operator NotXYZ() const; + %rename(opXYZ1) operator XYZ() const; + } + + %extend XYZ { + %rename(opAnother2) operator Another() const; + %rename(tMethod2) templateT(int i); + %rename(tMethodNotXYZ2) templateNotXYZ(NotXYZ); + %rename(tMethodXYZ2) templateXYZ(XYZ); + %rename(opT2) operator int(); + %rename(opNotXYZ2) operator NotXYZ() const; + %rename(opXYZ2) operator XYZ() const; + } + + %extend XYZ { + %rename(opAnother3) operator Another() const; + %rename(tMethod3) templateT(Space::Klass i); + %rename(tMethodNotXYZ3) templateNotXYZ(NotXYZ); + %rename(tMethodXYZ3) templateXYZ(XYZ); + %rename(opT3) operator Space::Klass(); + %rename(opNotXYZ3) operator NotXYZ() const; + %rename(opXYZ3) operator XYZ() const; + } + + %extend XYZ { + %rename(opAnother4 )operator Another() const; + %rename(tMethod4) templateT(Space::Enu i); + %rename(tMethodNotXYZ4) templateNotXYZ(NotXYZ); + %rename(tMethodXYZ4) templateXYZ(XYZ); + %rename(opT4) operator Space::Enu(); + %rename(opNotXYZ4) operator NotXYZ() const; + %rename(opXYZ4) operator XYZ() const; + } + + + %extend ABC { + %rename(methodABC) method(ABC a) const; + %rename(opABC) operator ABC() const; + %rename(methodKlass) method(Klass k) const; + %rename(opKlass) operator Klass() const; + } +} + +%{ +#include "rename.h" +%} +%include "rename.h" + +%template(XYZInt) Space::XYZ; +%template(XYZDouble) Space::XYZ; +%template(XYZKlass) Space::XYZ; +%template(XYZEnu) Space::XYZ; + +%template(NotXYZInt) Space::NotXYZ; +%template(NotXYZDouble) Space::NotXYZ; +%template(NotXYZKlass) Space::NotXYZ; +%template(NotXYZEnu) Space::NotXYZ; + diff --git a/Examples/test-suite/rename4.i b/Examples/test-suite/rename4.i new file mode 100644 index 000000000..3f61e0c69 --- /dev/null +++ b/Examples/test-suite/rename4.i @@ -0,0 +1,108 @@ +// Test %rename directive with the 'using' keyword and within the class definition +%module rename4 + +%{ +#include "rename.h" +%} + +namespace Space { +struct Klass { + Klass(int i) {} + Klass() {} +}; +} + +namespace AnotherSpace { + class Another {}; +} + +namespace Space { + %rename(opAnother1) XYZ::operator Another() const; + %rename(opAnother2) XYZ::operator Another() const; + %rename(opAnother3) XYZ::operator Another() const; + %rename(opAnother4) XYZ::operator Another() const; +} + +// Test %rename - no namespace, but specific templated type in the parameter, is used over the generic type T +%rename(tMethod2) templateT(int i); +%rename(tMethodNotXYZ2) templateNotXYZ(NotXYZ); +%rename(tMethodXYZ2) templateXYZ(XYZ); +%rename(opT2) operator int(); +%rename(opNotXYZ2) operator NotXYZ() const; +%rename(opXYZ2) operator XYZ() const; + +%rename(tMethod3) templateT(Space::Klass i); +%rename(tMethodNotXYZ3) templateNotXYZ(NotXYZ); +%rename(tMethodXYZ3) templateXYZ(XYZ); +%rename(opT3) operator Space::Klass(); +%rename(opNotXYZ3) operator NotXYZ() const; +%rename(opXYZ3) operator XYZ() const; + +%rename(tMethod4) templateT(Space::Enu i); +%rename(tMethodNotXYZ4) templateNotXYZ(NotXYZ); +%rename(tMethodXYZ4) templateXYZ(XYZ); +%rename(opT4) operator Space::Enu(); +%rename(opNotXYZ4) operator NotXYZ() const; +%rename(opXYZ4) operator XYZ() const; + +namespace Space { + using namespace AnotherSpace; + enum Enu { En1, En2, En3 }; + template struct NotXYZ {}; + template class XYZ { + + // Test %rename within the class + %rename(opIntPtrA) operator NotXYZ*() const; + %rename(opIntPtrB) operator XYZ*() const; + + %rename(tMethod1) templateT(T i); + %rename(tMethodNotXYZ1) templateNotXYZ(NotXYZ); + %rename(tMethodXYZ1) templateXYZ(XYZ); + %rename(opT1) operator T(); + %rename(opNotXYZ1) operator NotXYZ() const; + %rename(opXYZ1) operator XYZ() const; + + NotXYZ *m_int; + T m_t; + NotXYZ m_notxyz; + public: + operator NotXYZ*() const { return m_int; } + operator XYZ*() const { return 0; } + operator Another() const { Another an; return an; } + void templateT(T i) {} + void templateNotXYZ(NotXYZ i) {} + void templateXYZ(XYZ i) {} + operator T() { return m_t; } + operator NotXYZ() const { return m_notxyz; } + operator XYZ() const { XYZ xyz; return xyz; } + }; +} + +namespace Space { +// non-templated class using itself in method and operator +class ABC { + public: + + %rename(methodABC) method(ABC a) const; + %rename(opABC) operator ABC() const; + %rename(methodKlass) method(Klass k) const; + %rename(opKlass) operator Klass() const; + + void method(ABC a) const {} + void method(Klass k) const {} + operator ABC() const { ABC a; return a; } + operator Klass() const { Klass k; return k; } +}; +} + + +%template(XYZInt) Space::XYZ; +%template(XYZDouble) Space::XYZ; +%template(XYZKlass) Space::XYZ; +%template(XYZEnu) Space::XYZ; + +%template(NotXYZInt) Space::NotXYZ; +%template(NotXYZDouble) Space::NotXYZ; +%template(NotXYZKlass) Space::NotXYZ; +%template(NotXYZEnu) Space::NotXYZ; +