1 %{ 2 #include "expr/record.h" 3 4 #ifdef SWIGJAVA 5 6 #include "bindings/java_iterator_adapter.h" 7 #include "bindings/java_stream_adapters.h" 8 9 #endif /* SWIGJAVA */ 10 %} 11 12 %include "stdint.i" 13 14 %rename(equals) CVC4::RecordUpdate::operator==(const RecordUpdate&) const; 15 %ignore CVC4::RecordUpdate::operator!=(const RecordUpdate&) const; 16 17 %rename(equals) CVC4::Record::operator==(const Record&) const; 18 %ignore CVC4::Record::operator!=(const Record&) const; 19 %rename(getField) CVC4::Record::operator[](size_t) const; 20 21 %rename(apply) CVC4::RecordHashFunction::operator()(const Record&) const; 22 %rename(apply) CVC4::RecordUpdateHashFunction::operator()(const RecordUpdate&) const; 23 24 %ignore CVC4::operator<<(std::ostream&, const Record&); 25 %ignore CVC4::operator<<(std::ostream&, const RecordUpdate&); 26 27 #ifdef SWIGJAVA 28 29 // These Object arrays are always of two elements, the first is a String and the second a 30 // Type. (On the C++ side, it is a std::pair<std::string, Type>.) 31 %typemap(jni) std::pair<std::string, CVC4::Type> "jobjectArray"; 32 %typemap(jtype) std::pair<std::string, CVC4::Type> "java.lang.Object[]"; 33 %typemap(jstype) std::pair<std::string, CVC4::Type> "java.lang.Object[]"; 34 %typemap(javaout) std::pair<std::string, CVC4::Type> { return $jnicall; } 35 %typemap(out) std::pair<std::string, CVC4::Type> { 36 $result = jenv->NewObjectArray(2, jenv->FindClass("java/lang/Object"), $null); 37 jenv->SetObjectArrayElement($result, 0, jenv->NewStringUTF($1.first.c_str())); 38 jclass clazz = jenv->FindClass("edu/nyu/acsys/CVC4/Type"); 39 jmethodID methodid = jenv->GetMethodID(clazz, "<init>", "(JZ)V"); 40 jenv->SetObjectArrayElement($result, 1, jenv->NewObject(clazz, methodid, reinterpret_cast<uintptr_t>(new CVC4::Type($1.second)), true)); 41 }; 42 43 44 45 #endif /* SWIGJAVA */ 46 47 %include "expr/record.h" 48 49 #ifdef SWIGJAVA 50 51 %include "bindings/java_iterator_adapter.h" 52 %include "bindings/java_stream_adapters.h" 53 54 55 #endif /* SWIGJAVA */ 56