Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
add c exports for jni usage
Browse files Browse the repository at this point in the history
  • Loading branch information
andyh2 committed Nov 7, 2019
1 parent e77f41e commit c273054
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions messaging/messaging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,20 @@ Poller * Poller::create(std::vector<SubSocket*> sockets){
}
return p;
}

extern "C" Context * msgq_context_create() {
return Context::create();
}

extern "C" SubSocket * msgq_subsocket_create(Context* context, const char* endpoint) {
return SubSocket::create(context, std::string(endpoint));
}

extern "C" PubSocket * msgq_pubsocket_create(Context* context, const char* endpoint) {
return PubSocket::create(context, std::string(endpoint));
}

extern "C" Poller * msgq_poller_create(SubSocket** sockets, int size) {
std::vector<SubSocket*> socketsVec(sockets, sockets + size);
return Poller::create(socketsVec);
}

0 comments on commit c273054

Please sign in to comment.