callback_from_rust.h
Go to the documentation of this file.
1 //
2 // Created by nakakura on 22/09/04.
3 //
4 
6 #ifndef SKYWAY_FFI_BRIDGE_H
7 #define SKYWAY_FFI_BRIDGE_H
8 
9 #include <fruit/fruit.h>
10 #include <ros/ros.h>
11 
12 #include "common.h"
13 #include "ros_functions.h"
14 
15 using fruit::Component;
16 using fruit::Injector;
17 
18 // callback body
19 namespace {
20 std::function<void(int)> shutdown_handler;
21 std::function<void(char*, char*)> create_peer_callback_handler;
22 std::function<PluginLoadResult(char*, uint16_t, char*, char*)>
23  create_data_callback_handler;
24 std::function<void(uint16_t)> data_connection_close_event_callback_handler;
25 } // namespace
26 
28 
30  private:
31  void create_peer_callback(char* peer_id, char* token);
33  char*);
34  void delete_data_connection_callback(uint16_t);
35 
36  std::shared_ptr<Router> router_;
37 
38  public:
39  CallbackFromRustImpl() = delete;
40  INJECT(CallbackFromRustImpl(std::shared_ptr<Router> router));
41  virtual ~CallbackFromRustImpl() {}
42 };
43 
44 Component<CallbackFromRust> getCallbackFromRustComponent();
45 
46 #endif // SKYWAY_FFI_BRIDGE_H
CallbackFromRustImpl::INJECT
INJECT(CallbackFromRustImpl(std::shared_ptr< Router > router))
ros.h
CallbackFromRustImpl::create_data_connection_callback
PluginLoadResult create_data_connection_callback(char *, uint16_t, char *, char *)
Definition: callback_from_rust.cpp:63
PluginLoadResult
Definition: common.h:10
getCallbackFromRustComponent
Component< CallbackFromRust > getCallbackFromRustComponent()
Definition: callback_from_rust.cpp:81
ros_functions.h
CallbackFromRustImpl::create_peer_callback
void create_peer_callback(char *peer_id, char *token)
Definition: callback_from_rust.cpp:56
CallbackFromRustImpl
Definition: callback_from_rust.h:29
CallbackFromRustImpl::router_
std::shared_ptr< Router > router_
Definition: callback_from_rust.h:36
CallbackFromRustImpl::delete_data_connection_callback
void delete_data_connection_callback(uint16_t)
Definition: callback_from_rust.cpp:77
CallbackFromRustImpl::~CallbackFromRustImpl
virtual ~CallbackFromRustImpl()
Definition: callback_from_rust.h:41
CallbackFromRust
Definition: callback_from_rust.h:27
common.h
CallbackFromRustImpl::CallbackFromRustImpl
CallbackFromRustImpl()=delete
Definition: callback_from_rust.cpp:34


skyway
Author(s): Toshiya Nakakura
autogenerated on Thu Oct 26 2023 02:42:21