diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2013-03-27 23:42:13 -0400 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2013-03-27 23:42:13 -0400 |
commit | c90564313e268e403ca9a6c13a80432bd7a6fa79 (patch) | |
tree | 8d49eafcda3174042cce3cb364d61b0d53c3bd01 /src/util | |
parent | 2108ce5dfab34583f9abd07c077cd0b4f1f92499 (diff) |
some Java bindings fixes (fixes Debian build problems)
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/record.i | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/util/record.i b/src/util/record.i index 2805d2fdf..368519f5b 100644 --- a/src/util/record.i +++ b/src/util/record.i @@ -19,6 +19,8 @@ %ignore CVC4::Record::operator!=(const Record&) const; %rename(getField) CVC4::Record::operator[](size_t) const; +#ifdef SWIGJAVA + // These Object arrays are always of two elements, the first is a String and the second a // Type. (On the C++ side, it is a std::pair<std::string, Type>.) %typemap(jni) std::pair<std::string, CVC4::Type> "jobjectArray"; @@ -33,8 +35,6 @@ jenv->SetObjectArrayElement($result, 1, jenv->NewObject(clazz, methodid, reinterpret_cast<long>(new CVC4::Type($1.second)), true)); }; -#ifdef SWIGJAVA - // Instead of Record::begin() and end(), create an // iterator() method on the Java side that returns a Java-style // Iterator. @@ -79,6 +79,15 @@ // getNext() just allows C++ iterator access from Java-side next(), make it private %javamethodmodifiers CVC4::JavaIteratorAdapter<CVC4::Record>::getNext() "private"; +// map the types appropriately. for records, the "payload" of the iterator is an Object[]. +// These Object arrays are always of two elements, the first is a String and the second a +// Type. (On the C++ side, it is a std::pair<std::string, SExpr>.) +%typemap(jni) CVC4::Record::const_iterator::value_type = std::pair<std::string, CVC4::Type>; +%typemap(jtype) CVC4::Record::const_iterator::value_type = std::pair<std::string, CVC4::Type>; +%typemap(jstype) CVC4::Record::const_iterator::value_type = std::pair<std::string, CVC4::Type>; +%typemap(javaout) CVC4::Record::const_iterator::value_type = std::pair<std::string, CVC4::Type>; +%typemap(out) CVC4::Record::const_iterator::value_type = std::pair<std::string, CVC4::Type>; + #endif /* SWIGJAVA */ %include "util/record.h" |