13 create_peer_callback_handler(peer_id, token);
22 return create_data_callback_handler(target_ip, target_port, plugin_type,
27 data_connection_close_event_callback_handler(port_num);
35 : router_(
std::move(router)) {
36 create_peer_callback_handler =
38 std::placeholders::_1, std::placeholders::_2);
40 create_data_callback_handler =
42 std::placeholders::_1, std::placeholders::_2,
43 std::placeholders::_3, std::placeholders::_4);
45 data_connection_close_event_callback_handler =
47 std::placeholders::_1);
57 router_->OnCreatePeer(peer_id, token);
64 char* target_ip, uint16_t port,
char* plugin_type,
char* plugin_param) {
66 router_->OnConnectData(target_ip, port, plugin_type, plugin_param);
73 .error_message = result.error_message};
78 router_->OnDeleteData(port_num);
82 return fruit::createComponent()
void peer_deleted_callback_ffi()
Component< CallbackFromRust > getCallbackFromRustComponent()
void create_peer_callback(char *peer_id, char *token)
std::shared_ptr< Router > router_
Component< Router > getRouterComponent()
void register_callbacks(Function &functions)
void create_peer_callback_ffi(char *peer_id, char *token)
PluginLoadResult create_data_callback_ffi(char *target_ip, uint16_t target_port, char *plugin_type, char *plugin_param)
PluginLoadResult create_data_connection_callback(char *, uint16_t, char *, char *)
void delete_data_connection_callback(uint16_t)
CallbackFromRustImpl()=delete
void release_string(char *message)
void data_connection_close_event_callback_ffi(uint16_t port_num)
ROSCPP_DECL void shutdown()
void release_string_ffi(char *str)