diff options
Diffstat (limited to 'src/proof')
-rw-r--r-- | src/proof/unsat_core.i | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/proof/unsat_core.i b/src/proof/unsat_core.i index cee78da06..d3fd615ce 100644 --- a/src/proof/unsat_core.i +++ b/src/proof/unsat_core.i @@ -21,8 +21,16 @@ %ignore CVC4::UnsatCore::begin() const; %ignore CVC4::UnsatCore::end() const; %extend CVC4::UnsatCore { - CVC4::JavaIteratorAdapter<CVC4::UnsatCore> iterator() { - return CVC4::JavaIteratorAdapter<CVC4::UnsatCore>(*$self); + CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> iterator() + { + return CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>(*$self); + } + + std::string toString() + { + std::stringstream ss; + ss << (*$self); + return ss.str(); } } @@ -30,10 +38,10 @@ %typemap(javainterfaces) CVC4::UnsatCore "java.lang.Iterable<edu.nyu.acsys.CVC4.Expr>"; // the JavaIteratorAdapter should not be public, and implements Iterator -%typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter<CVC4::UnsatCore> "class"; -%typemap(javainterfaces) CVC4::JavaIteratorAdapter<CVC4::UnsatCore> "java.util.Iterator<edu.nyu.acsys.CVC4.Expr>"; +%typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> "class"; +%typemap(javainterfaces) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> "java.util.Iterator<edu.nyu.acsys.CVC4.Expr>"; // add some functions to the Java side (do it here because there's no way to do these in C++) -%typemap(javacode) CVC4::JavaIteratorAdapter<CVC4::UnsatCore> " +%typemap(javacode) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> " public void remove() { throw new java.lang.UnsupportedOperationException(); } @@ -47,13 +55,7 @@ } " // getNext() just allows C++ iterator access from Java-side next(), make it private -%javamethodmodifiers CVC4::JavaIteratorAdapter<CVC4::UnsatCore>::getNext() "private"; - -// map the types appropriately -%typemap(jni) CVC4::UnsatCore::const_iterator::value_type "jobject"; -%typemap(jtype) CVC4::UnsatCore::const_iterator::value_type "edu.nyu.acsys.CVC4.Expr"; -%typemap(jstype) CVC4::UnsatCore::const_iterator::value_type "edu.nyu.acsys.CVC4.Expr"; -%typemap(javaout) CVC4::UnsatCore::const_iterator::value_type { return $jnicall; } +%javamethodmodifiers CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>::getNext() "private"; #endif /* SWIGJAVA */ @@ -61,9 +63,10 @@ #ifdef SWIGJAVA +%include <std_vector.i> + %include "bindings/java_iterator_adapter.h" -%include "bindings/java_stream_adapters.h" -%template(JavaIteratorAdapter_UnsatCore) CVC4::JavaIteratorAdapter<CVC4::UnsatCore>; +%template(JavaIteratorAdapter_UnsatCore) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>; #endif /* SWIGJAVA */ |