From 8f366ab96d550a5f9c18857a40c3c3f595b92634 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 23 Oct 2024 19:42:16 +0800 Subject: [PATCH] recover removed methods of Message --- .github/workflows/cpp_workflow.yml | 3 - cpp/cmake/Options.cmake | 4 + cpp/ppc-framework/protocol/PPCMessageFace.h | 2 +- .../ppc-crypto-core/src/CMakeLists.txt | 3 +- cpp/wedpr-protocol/grpc/CMakeLists.txt | 2 +- .../protocol/tests/CMakeLists.txt | 2 +- .../wedpr/sdk/jni/generated/Message.java | 51 +- .../generated/wedpr_java_transportJNI.java | 26 +- .../src/wedpr_java_transportJAVA_wrap.cxx | 213 +++++++- .../generated/wedpr_python_transport.py | 37 +- .../src/wedpr_python_transportPYTHON_wrap.cxx | 489 ++++++++++++++++-- 11 files changed, 747 insertions(+), 85 deletions(-) diff --git a/.github/workflows/cpp_workflow.yml b/.github/workflows/cpp_workflow.yml index 376f5a4b..55f74b59 100644 --- a/.github/workflows/cpp_workflow.yml +++ b/.github/workflows/cpp_workflow.yml @@ -278,9 +278,6 @@ jobs: run: | alias cmake='cmake3' . /opt/rh/devtoolset-11/enable - . /opt/rh/rh-perl530/enable - export LIBCLANG_PATH=/opt/rh/llvm-toolset-7/root/lib64/ - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" mkdir -p cpp/build cd cpp/build cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ../ diff --git a/cpp/cmake/Options.cmake b/cpp/cmake/Options.cmake index f890b106..212ce9ca 100644 --- a/cpp/cmake/Options.cmake +++ b/cpp/cmake/Options.cmake @@ -66,6 +66,10 @@ macro(configure_project) endif () set(VISIBILITY_FLAG " -fvisibility=hidden -fvisibility-inlines-hidden") + set(PROGRAM_POSTFIX "") + if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") + set(PROGRAM_POSTFIX ".exe") + endif() set(MARCH_TYPE "-march=x86-64 -mtune=generic ${VISIBILITY_FLAG}") if (ARCH_NATIVE) diff --git a/cpp/ppc-framework/protocol/PPCMessageFace.h b/cpp/ppc-framework/protocol/PPCMessageFace.h index abee0138..04fc9a76 100644 --- a/cpp/ppc-framework/protocol/PPCMessageFace.h +++ b/cpp/ppc-framework/protocol/PPCMessageFace.h @@ -21,7 +21,7 @@ #pragma once #include "Protocol.h" -#include "ppc-framework/protocol/P2PMessage.h" +#include "ppc-framework/protocol/Message.h" #include #include #include diff --git a/cpp/wedpr-crypto/ppc-crypto-core/src/CMakeLists.txt b/cpp/wedpr-crypto/ppc-crypto-core/src/CMakeLists.txt index 3387e7a2..2a56797c 100644 --- a/cpp/wedpr-crypto/ppc-crypto-core/src/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-crypto-core/src/CMakeLists.txt @@ -5,5 +5,4 @@ find_package(OpenSSL REQUIRED) message(STATUS "OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") message(STATUS "OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -target_link_libraries(${CRYPTO_CORE_TARGET} PUBLIC unofficial-sodium::sodium - unofficial-sodium::sodium_config_public ${BCOS_UTILITIES_TARGET} OpenSSL::Crypto ${CPU_FEATURES_LIB}) \ No newline at end of file +target_link_libraries(${CRYPTO_CORE_TARGET} PUBLIC unofficial-sodium::sodium ${BCOS_UTILITIES_TARGET} OpenSSL::Crypto ${CPU_FEATURES_LIB}) \ No newline at end of file diff --git a/cpp/wedpr-protocol/grpc/CMakeLists.txt b/cpp/wedpr-protocol/grpc/CMakeLists.txt index a45b773d..64ea4ea1 100644 --- a/cpp/wedpr-protocol/grpc/CMakeLists.txt +++ b/cpp/wedpr-protocol/grpc/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE MESSAGES_PROTOS "${PROTO_INPUT_PATH}/Service*.proto") # create PROTO_OUTPUT_PATH file(MAKE_DIRECTORY ${PROTO_OUTPUT_PATH}) - +set(GRPC_CPP_PLUGIN_EXEC "grpc_cpp_plugin${PROGRAM_POSTFIX}") find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin REQUIRED) find_program(PROTOC_BINARY protoc REQUIRED) diff --git a/cpp/wedpr-protocol/protocol/tests/CMakeLists.txt b/cpp/wedpr-protocol/protocol/tests/CMakeLists.txt index 4466ace3..3248c2ec 100644 --- a/cpp/wedpr-protocol/protocol/tests/CMakeLists.txt +++ b/cpp/wedpr-protocol/protocol/tests/CMakeLists.txt @@ -6,5 +6,5 @@ set(TEST_BINARY_NAME test-protocol) add_executable(${TEST_BINARY_NAME} ${SOURCES}) target_include_directories(${TEST_BINARY_NAME} PRIVATE .) -target_link_libraries(${TEST_BINARY_NAME} ${PROTOCOL_TARGET} TBB::tbb ${BOOST_UNIT_TEST}) +target_link_libraries(${TEST_BINARY_NAME} ${PROTOCOL_TARGET} ${BCOS_UTILITIES_TARGET} TBB::tbb ${BOOST_UNIT_TEST}) add_test(NAME test-protocol WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) \ No newline at end of file diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java index 833c1152..dc50506c 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java @@ -50,6 +50,52 @@ public void setHeader(MessageHeader header) { swigCPtr, this, MessageHeader.getCPtr(header), header); } + /** the overloaed implementation === */ + public int version() { + return wedpr_java_transportJNI.Message_version(swigCPtr, this); + } + + public void setVersion(int version) { + wedpr_java_transportJNI.Message_setVersion(swigCPtr, this, version); + } + + public int packetType() { + return wedpr_java_transportJNI.Message_packetType(swigCPtr, this); + } + + public void setPacketType(int packetType) { + wedpr_java_transportJNI.Message_setPacketType(swigCPtr, this, packetType); + } + + public String seq() { + return wedpr_java_transportJNI.Message_seq(swigCPtr, this); + } + + public void setSeq(String traceID) { + wedpr_java_transportJNI.Message_setSeq(swigCPtr, this, traceID); + } + + public int ext() { + return wedpr_java_transportJNI.Message_ext(swigCPtr, this); + } + + public void setExt(int ext) { + wedpr_java_transportJNI.Message_setExt(swigCPtr, this, ext); + } + + public boolean isRespPacket() { + return wedpr_java_transportJNI.Message_isRespPacket(swigCPtr, this); + } + + public void setRespPacket() { + wedpr_java_transportJNI.Message_setRespPacket(swigCPtr, this); + } + + public void setPayload(ubytes _payload) { + wedpr_java_transportJNI.Message_setPayload( + swigCPtr, this, ubytes.getCPtr(_payload), _payload); + } + public byte[] payloadBuffer() { return wedpr_java_transportJNI.Message_payloadBuffer(swigCPtr, this); } @@ -83,11 +129,6 @@ public ubytes payload() { return (cPtr == 0) ? null : new ubytes(cPtr, true); } - public void setPayload(ubytes _payload) { - wedpr_java_transportJNI.Message_setPayload( - swigCPtr, this, ubytes.getCPtr(_payload), _payload); - } - public void disOwnMemory() { swigSetCMemOwn(false); } diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java index 15f817f2..814c24f8 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java @@ -489,6 +489,29 @@ public static final native boolean MessageHeader_hasOptionalField( public static final native void Message_setHeader( long jarg1, Message jarg1_, long jarg2, MessageHeader jarg2_); + public static final native int Message_version(long jarg1, Message jarg1_); + + public static final native void Message_setVersion(long jarg1, Message jarg1_, int jarg2); + + public static final native int Message_packetType(long jarg1, Message jarg1_); + + public static final native void Message_setPacketType(long jarg1, Message jarg1_, int jarg2); + + public static final native String Message_seq(long jarg1, Message jarg1_); + + public static final native void Message_setSeq(long jarg1, Message jarg1_, String jarg2); + + public static final native int Message_ext(long jarg1, Message jarg1_); + + public static final native void Message_setExt(long jarg1, Message jarg1_, int jarg2); + + public static final native boolean Message_isRespPacket(long jarg1, Message jarg1_); + + public static final native void Message_setRespPacket(long jarg1, Message jarg1_); + + public static final native void Message_setPayload( + long jarg1, Message jarg1_, long jarg2, ubytes jarg2_); + public static final native byte[] Message_payloadBuffer(long jarg1, Message jarg1_); public static final native void Message_setFrontMessage( @@ -505,9 +528,6 @@ public static final native boolean Message_encode( public static final native long Message_payload(long jarg1, Message jarg1_); - public static final native void Message_setPayload( - long jarg1, Message jarg1_, long jarg2, ubytes jarg2_); - public static final native void delete_MessageHeaderBuilder(long jarg1); public static final native long MessageHeaderBuilder_build__SWIG_0( diff --git a/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx b/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx index 0be323b3..807fb464 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx +++ b/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx @@ -5072,6 +5072,200 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } +SWIGEXPORT jint JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1version(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + uint16_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + result = (uint16_t)((ppc::protocol::Message const *)arg1)->version(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setVersion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + arg2 = (uint16_t)jarg2; + (arg1)->setVersion(arg2); +} + + +SWIGEXPORT jint JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1packetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + uint16_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + result = (uint16_t)((ppc::protocol::Message const *)arg1)->packetType(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setPacketType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + arg2 = (uint16_t)jarg2; + (arg1)->setPacketType(arg2); +} + + +SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1seq(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + std::string *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + result = (std::string *) &((ppc::protocol::Message const *)arg1)->seq(); + jresult = jenv->NewStringUTF(result->c_str()); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setSeq(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::string arg2 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + if(!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return ; + } + const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2_pstr) return ; + (&arg2)->assign(arg2_pstr); + jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); + (arg1)->setSeq(arg2); +} + + +SWIGEXPORT jint JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1ext(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + uint16_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + result = (uint16_t)((ppc::protocol::Message const *)arg1)->ext(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setExt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + arg2 = (uint16_t)jarg2; + (arg1)->setExt(arg2); +} + + +SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1isRespPacket(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + result = (bool)((ppc::protocol::Message const *)arg1)->isRespPacket(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setRespPacket(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + (arg1)->setRespPacket(); +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setPayload(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< bcos::bytes > arg2 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + std::shared_ptr< bcos::bytes > *argp2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + argp2 = *(std::shared_ptr< bcos::bytes > **)&jarg2; + if (argp2) arg2 = *argp2; + (arg1)->setPayload(arg2); +} + + SWIGEXPORT jbyteArray JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1payloadBuffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jbyteArray jresult = 0 ; ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; @@ -5218,25 +5412,6 @@ SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tr } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setPayload(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; - std::shared_ptr< bcos::bytes > arg2 ; - std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; - std::shared_ptr< bcos::bytes > *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; - arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); - argp2 = *(std::shared_ptr< bcos::bytes > **)&jarg2; - if (argp2) arg2 = *argp2; - (arg1)->setPayload(arg2); -} - - SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_delete_1MessageHeaderBuilder(JNIEnv *jenv, jclass jcls, jlong jarg1) { ppc::protocol::MessageHeaderBuilder *arg1 = (ppc::protocol::MessageHeaderBuilder *) 0 ; std::shared_ptr< ppc::protocol::MessageHeaderBuilder > *smartarg1 = 0 ; diff --git a/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py b/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py index a344353c..9b02b5e6 100644 --- a/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py +++ b/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py @@ -1168,6 +1168,40 @@ def header(self): def setHeader(self, header): return _wedpr_python_transport.Message_setHeader(self, header) + def version(self): + r""" the overloaed implementation ===""" + return _wedpr_python_transport.Message_version(self) + + def setVersion(self, version): + return _wedpr_python_transport.Message_setVersion(self, version) + + def packetType(self): + return _wedpr_python_transport.Message_packetType(self) + + def setPacketType(self, packetType): + return _wedpr_python_transport.Message_setPacketType(self, packetType) + + def seq(self): + return _wedpr_python_transport.Message_seq(self) + + def setSeq(self, traceID): + return _wedpr_python_transport.Message_setSeq(self, traceID) + + def ext(self): + return _wedpr_python_transport.Message_ext(self) + + def setExt(self, ext): + return _wedpr_python_transport.Message_setExt(self, ext) + + def isRespPacket(self): + return _wedpr_python_transport.Message_isRespPacket(self) + + def setRespPacket(self): + return _wedpr_python_transport.Message_setRespPacket(self) + + def setPayload(self, _payload): + return _wedpr_python_transport.Message_setPayload(self, _payload) + def payloadBuffer(self): return _wedpr_python_transport.Message_payloadBuffer(self) @@ -1189,9 +1223,6 @@ def length(self): def payload(self): return _wedpr_python_transport.Message_payload(self) - def setPayload(self, _payload): - return _wedpr_python_transport.Message_setPayload(self, _payload) - # Register Message in _wedpr_python_transport: _wedpr_python_transport.Message_swigregister(Message) diff --git a/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx b/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx index 96b87422..d93bbbfe 100644 --- a/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx +++ b/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx @@ -18958,6 +18958,437 @@ SWIGINTERN PyObject *_wrap_Message_setHeader(PyObject *self, PyObject *args) { } +SWIGINTERN PyObject *_wrap_Message_version(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message const > tempshared1 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + uint16_t result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_version" "', argument " "1"" of type '" "ppc::protocol::Message const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + result = (uint16_t)((ppc::protocol::Message const *)arg1)->version(); + resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setVersion(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Message_setVersion", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setVersion" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Message_setVersion" "', argument " "2"" of type '" "uint16_t""'"); + } + arg2 = static_cast< uint16_t >(val2); + (arg1)->setVersion(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_packetType(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message const > tempshared1 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + uint16_t result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_packetType" "', argument " "1"" of type '" "ppc::protocol::Message const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + result = (uint16_t)((ppc::protocol::Message const *)arg1)->packetType(); + resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setPacketType(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Message_setPacketType", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setPacketType" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Message_setPacketType" "', argument " "2"" of type '" "uint16_t""'"); + } + arg2 = static_cast< uint16_t >(val2); + (arg1)->setPacketType(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_seq(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message const > tempshared1 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + std::string *result = 0 ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_seq" "', argument " "1"" of type '" "ppc::protocol::Message const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + result = (std::string *) &((ppc::protocol::Message const *)arg1)->seq(); + resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setSeq(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::string arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Message_setSeq", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setSeq" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Message_setSeq" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + (arg1)->setSeq(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_ext(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message const > tempshared1 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + uint16_t result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_ext" "', argument " "1"" of type '" "ppc::protocol::Message const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + result = (uint16_t)((ppc::protocol::Message const *)arg1)->ext(); + resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setExt(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + uint16_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + unsigned short val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Message_setExt", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setExt" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Message_setExt" "', argument " "2"" of type '" "uint16_t""'"); + } + arg2 = static_cast< uint16_t >(val2); + (arg1)->setExt(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_isRespPacket(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message const > tempshared1 ; + std::shared_ptr< ppc::protocol::Message const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_isRespPacket" "', argument " "1"" of type '" "ppc::protocol::Message const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + result = (bool)((ppc::protocol::Message const *)arg1)->isRespPacket(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setRespPacket(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setRespPacket" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + (arg1)->setRespPacket(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Message_setPayload(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< bcos::bytes > arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + void *argp2 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Message_setPayload", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setPayload" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + { + int newmem = 0; + res2 = SWIG_ConvertPtrAndOwn(swig_obj[1], &argp2, SWIGTYPE_p_std__shared_ptrT_bcos__bytes_t, 0 , &newmem); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Message_setPayload" "', argument " "2"" of type '" "std::shared_ptr< bcos::bytes >""'"); + } + if (argp2) arg2 = *(reinterpret_cast< std::shared_ptr< bcos::bytes > * >(argp2)); + if (newmem & SWIG_CAST_NEW_MEMORY) delete reinterpret_cast< std::shared_ptr< bcos::bytes > * >(argp2); + } + (arg1)->setPayload(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Message_payloadBuffer(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; @@ -19263,52 +19694,6 @@ SWIGINTERN PyObject *_wrap_Message_payload(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_Message_setPayload(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; - std::shared_ptr< bcos::bytes > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - std::shared_ptr< ppc::protocol::Message > tempshared1 ; - std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - (void)self; - if (!SWIG_Python_UnpackTuple(args, "Message_setPayload", 2, 2, swig_obj)) SWIG_fail; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setPayload" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); - } - } - { - int newmem = 0; - res2 = SWIG_ConvertPtrAndOwn(swig_obj[1], &argp2, SWIGTYPE_p_std__shared_ptrT_bcos__bytes_t, 0 , &newmem); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Message_setPayload" "', argument " "2"" of type '" "std::shared_ptr< bcos::bytes >""'"); - } - if (argp2) arg2 = *(reinterpret_cast< std::shared_ptr< bcos::bytes > * >(argp2)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete reinterpret_cast< std::shared_ptr< bcos::bytes > * >(argp2); - } - (arg1)->setPayload(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *Message_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -24220,6 +24605,17 @@ static PyMethodDef SwigMethods[] = { { "delete_Message", _wrap_delete_Message, METH_O, NULL}, { "Message_header", _wrap_Message_header, METH_O, NULL}, { "Message_setHeader", _wrap_Message_setHeader, METH_VARARGS, NULL}, + { "Message_version", _wrap_Message_version, METH_O, " the overloaed implementation ==="}, + { "Message_setVersion", _wrap_Message_setVersion, METH_VARARGS, NULL}, + { "Message_packetType", _wrap_Message_packetType, METH_O, NULL}, + { "Message_setPacketType", _wrap_Message_setPacketType, METH_VARARGS, NULL}, + { "Message_seq", _wrap_Message_seq, METH_O, NULL}, + { "Message_setSeq", _wrap_Message_setSeq, METH_VARARGS, NULL}, + { "Message_ext", _wrap_Message_ext, METH_O, NULL}, + { "Message_setExt", _wrap_Message_setExt, METH_VARARGS, NULL}, + { "Message_isRespPacket", _wrap_Message_isRespPacket, METH_O, NULL}, + { "Message_setRespPacket", _wrap_Message_setRespPacket, METH_O, NULL}, + { "Message_setPayload", _wrap_Message_setPayload, METH_VARARGS, NULL}, { "Message_payloadBuffer", _wrap_Message_payloadBuffer, METH_O, NULL}, { "Message_setFrontMessage", _wrap_Message_setFrontMessage, METH_VARARGS, NULL}, { "Message_frontMessage", _wrap_Message_frontMessage, METH_O, NULL}, @@ -24227,7 +24623,6 @@ static PyMethodDef SwigMethods[] = { { "Message_decode", _wrap_Message_decode, METH_VARARGS, NULL}, { "Message_length", _wrap_Message_length, METH_O, NULL}, { "Message_payload", _wrap_Message_payload, METH_O, NULL}, - { "Message_setPayload", _wrap_Message_setPayload, METH_VARARGS, NULL}, { "Message_swigregister", Message_swigregister, METH_O, NULL}, { "delete_MessageHeaderBuilder", _wrap_delete_MessageHeaderBuilder, METH_O, NULL}, { "MessageHeaderBuilder_build", _wrap_MessageHeaderBuilder_build, METH_VARARGS, NULL},