Skip to content

Commit

Permalink
remove some swig interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Sep 14, 2024
1 parent 5692185 commit ca40183
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cpp_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
- name: Prepare vcpkg
if: runner.os != 'Windows'
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 7e3dcf74e37034eea358934a90a11d618520e139 }
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-07-28
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/Coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function(config_coverage TARGET REMOVE_FILE_PATTERN)
message(STATUS "coverage REMOVE_FILE_PATTERN: " ${REMOVE_FILE_PATTERN})
if (APPLE)
add_custom_target(${TARGET}
COMMAND ${LCOV_TOOL} -keep-going --ignore-errors inconsistent,unmapped,source --rc lcov_branch_coverage=1 -o ${CMAKE_BINARY_DIR}/coverage.info.in -c -i -d ${CMAKE_BINARY_DIR}/
COMMAND ${LCOV_TOOL} -keep-going --ignore-errors inconsistent,unmapped,source --rc lcov_branch_coverage=1 -o ${CMAKE_BINARY_DIR}/coverage.info.in -c -d ${CMAKE_BINARY_DIR}/
COMMAND ${LCOV_TOOL} -keep-going --ignore-errors inconsistent,unmapped,source --rc lcov_branch_coverage=1 -r ${CMAKE_BINARY_DIR}/coverage.info.in '*MacOS*' '/usr*' '.*vcpkg_installed*' '.*boost/*' '*test*' '*build*' '*deps*' ${REMOVE_FILE_PATTERN} -o ${CMAKE_BINARY_DIR}/coverage.info
COMMAND genhtml --keep-going --ignore-errors inconsistent,unmapped,source --rc lcov_branch_coverage=1 -q -o ${CMAKE_BINARY_DIR}/CodeCoverage ${CMAKE_BINARY_DIR}/coverage.info)
else()
add_custom_target(${TARGET}
COMMAND ${LCOV_TOOL} --rc lcov_branch_coverage=1 -o ${CMAKE_BINARY_DIR}/coverage.info.in -c -i -d ${CMAKE_BINARY_DIR}/
COMMAND ${LCOV_TOOL} --rc lcov_branch_coverage=1 -o ${CMAKE_BINARY_DIR}/coverage.info.in -c -d ${CMAKE_BINARY_DIR}/
COMMAND ${LCOV_TOOL} --rc lcov_branch_coverage=1 -r ${CMAKE_BINARY_DIR}/coverage.info.in '*MacOS*' '/usr*' '.*vcpkg_installed*' '.*boost/*' '*test*' '*build*' '*deps*' ${REMOVE_FILE_PATTERN} -o ${CMAKE_BINARY_DIR}/coverage.info
COMMAND genhtml --rc lcov_branch_coverage=1 -q -o ${CMAKE_BINARY_DIR}/CodeCoverage ${CMAKE_BINARY_DIR}/coverage.info)
endif()
Expand Down
8 changes: 4 additions & 4 deletions cpp/ppc-framework/front/IFront.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class IFront : virtual public IFrontClient
std::string const& topic, ppc::protocol::MessageDispatcherCallback callback) = 0;

/////// to simplify SDK wrapper ////
virtual void registerTopicHandler(
virtual void register_topic_handler(
std::string const& topic, MessageDispatcherHandler::Ptr callback)
{
registerTopicHandler(topic, populateMessageDispatcherCallback(callback));
Expand All @@ -135,7 +135,7 @@ class IFront : virtual public IFrontClient
std::string const& componentType, ppc::protocol::MessageDispatcherCallback callback) = 0;

/////// to simplify SDK wrapper ////
virtual void registerMessageHandler(
virtual void register_msg_handler(
std::string const& componentType, MessageDispatcherHandler::Ptr callback)
{
registerMessageHandler(componentType, populateMessageDispatcherCallback(callback));
Expand Down Expand Up @@ -165,7 +165,7 @@ class IFront : virtual public IFrontClient

// !!! Note: the 'payload' type(char*) should not been changed, since it used to pass-in java
// byte[] data
virtual void asyncSendMessage(uint16_t routeType,
virtual void async_send_message(uint16_t routeType,
ppc::protocol::MessageOptionalHeader::Ptr const& routeInfo, char* payload,
uint64_t payloadSize, int seq, long timeout, ErrorCallback::Ptr errorCallback,
IMessageHandler::Ptr msgHandler)
Expand All @@ -183,7 +183,7 @@ class IFront : virtual public IFrontClient

// !!! Note: the 'payload ' type(char*) should not been changed, since it used to pass-in java
// byte[] data
virtual void asyncSendResponse(bcos::bytes const& dstNode, std::string const& traceID,
virtual void async_send_response(bcos::bytes const& dstNode, std::string const& traceID,
bcos::bytes&& payload, int seq, ErrorCallback::Ptr errorCallback)
{
asyncSendResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,90 +59,21 @@ public void stop() {
wedpr_java_transportJNI.IFront_stop(swigCPtr, this);
}

/**
* <br>
*
* @param topic the topic<br>
* @param callback the callback called when receive specified topic
*/
public void registerTopicHandler(
String topic,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_ppc__protocol__Message_tF_t callback) {
wedpr_java_transportJNI.IFront_registerTopicHandler__SWIG_0(
swigCPtr,
this,
topic,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_ppc__protocol__Message_tF_t
.getCPtr(callback));
}

public void registerTopicHandler(String topic, MessageDispatcherHandler callback) {
wedpr_java_transportJNI.IFront_registerTopicHandler__SWIG_1(
public void register_topic_handler(String topic, MessageDispatcherHandler callback) {
wedpr_java_transportJNI.IFront_register_topic_handler(
swigCPtr, this, topic, MessageDispatcherHandler.getCPtr(callback), callback);
}

public void registerMessageHandler(
String componentType,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_ppc__protocol__Message_tF_t callback) {
wedpr_java_transportJNI.IFront_registerMessageHandler__SWIG_0(
swigCPtr,
this,
componentType,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_ppc__protocol__Message_tF_t
.getCPtr(callback));
}

public void registerMessageHandler(String componentType, MessageDispatcherHandler callback) {
wedpr_java_transportJNI.IFront_registerMessageHandler__SWIG_1(
public void register_msg_handler(String componentType, MessageDispatcherHandler callback) {
wedpr_java_transportJNI.IFront_register_msg_handler(
swigCPtr,
this,
componentType,
MessageDispatcherHandler.getCPtr(callback),
callback);
}

/**
* async send message<br>
* <br>
*
* @param routeType the route type<br>
* @param routeInfo the route info, include<br>
* - topic the topic<br>
* - dstInst the dst agency(must set when 'route by agency' and 'route by<br>
* component')<br>
* - dstNodeID the dst nodeID(must set when 'route by nodeID')<br>
* - componentType the componentType(must set when 'route by component')<br>
* @param payload the payload to send<br>
* @param seq the message seq<br>
* @param timeout timeout<br>
* @param callback callback
*/
public void asyncSendMessage(
int routeType,
MessageOptionalHeader routeInfo,
ubytes payload,
int seq,
int timeout,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_tF_t errorCallback,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_t_std__shared_ptrT_ppc__protocol__Message_t_std__functionT_void_fstd__shared_ptrT_bcos__bytes_t_RRF_tF_t
callback) {
wedpr_java_transportJNI.IFront_asyncSendMessage__SWIG_0(
swigCPtr,
this,
routeType,
MessageOptionalHeader.getCPtr(routeInfo),
routeInfo,
ubytes.swigRelease(payload),
payload,
seq,
timeout,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_tF_t.getCPtr(
errorCallback),
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_t_std__shared_ptrT_ppc__protocol__Message_t_std__functionT_void_fstd__shared_ptrT_bcos__bytes_t_RRF_tF_t
.getCPtr(callback));
}

public void asyncSendMessage(
public void async_send_message(
int routeType,
MessageOptionalHeader routeInfo,
byte[] payload,
Expand All @@ -151,7 +82,7 @@ public void asyncSendMessage(
int timeout,
ErrorCallback errorCallback,
IMessageHandler msgHandler) {
wedpr_java_transportJNI.IFront_asyncSendMessage__SWIG_1(
wedpr_java_transportJNI.IFront_async_send_message(
swigCPtr,
this,
routeType,
Expand All @@ -167,28 +98,9 @@ public void asyncSendMessage(
msgHandler);
}

public void asyncSendResponse(
ubytes dstNode,
String traceID,
ubytes payload,
int seq,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_tF_t errorCallback) {
wedpr_java_transportJNI.IFront_asyncSendResponse__SWIG_0(
swigCPtr,
this,
ubytes.getCPtr(dstNode),
dstNode,
traceID,
ubytes.swigRelease(payload),
payload,
seq,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_tF_t.getCPtr(
errorCallback));
}

public void asyncSendResponse(
public void async_send_response(
ubytes dstNode, String traceID, ubytes payload, int seq, ErrorCallback errorCallback) {
wedpr_java_transportJNI.IFront_asyncSendResponse__SWIG_1(
wedpr_java_transportJNI.IFront_async_send_response(
swigCPtr,
this,
ubytes.getCPtr(dstNode),
Expand Down Expand Up @@ -248,16 +160,6 @@ public Message peek(String topic) {
return (cPtr == 0) ? null : new Message(cPtr, true);
}

public void asyncGetAgencies(
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_t_std__setT_std__string_tF_t
callback) {
wedpr_java_transportJNI.IFront_asyncGetAgencies(
swigCPtr,
this,
SWIGTYPE_p_std__functionT_void_fstd__shared_ptrT_bcos__Error_t_std__setT_std__string_tF_t
.getCPtr(callback));
}

/**
* register the nodeInfo to the gateway<br>
*
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ public TransportBuilder() {
this(wedpr_java_transportJNI.new_TransportBuilder(), true);
}

public Transport build(
SDKMode mode, FrontConfig config, SWIGTYPE_p_ppc__gateway__IGateway__Ptr gateway) {
long cPtr =
wedpr_java_transportJNI.TransportBuilder_build(
swigCPtr,
this,
mode.swigValue(),
FrontConfig.getCPtr(config),
config,
SWIGTYPE_p_ppc__gateway__IGateway__Ptr.getCPtr(gateway));
return (cPtr == 0) ? null : new Transport(cPtr, true);
}

public Transport buildProTransport(FrontConfig config) {
long cPtr =
wedpr_java_transportJNI.TransportBuilder_buildProTransport(
Expand Down
Loading

0 comments on commit ca40183

Please sign in to comment.