51class ROBOTRACONTEUR_CORE_API
HardwareTransport :
public Transport,
public RR_ENABLE_SHARED_FROM_THIS<HardwareTransport>
53 friend class HardwareTransportConnection;
59 RR_UNORDERED_MAP<uint32_t, RR_SHARED_PTR<ITransportConnection> > TransportConnections;
60 boost::mutex TransportConnections_lock;
79 RR_OVIRTUAL
bool IsServer() const RR_OVERRIDE;
81 RR_OVIRTUAL
bool IsClient() const RR_OVERRIDE;
83 RR_OVIRTUAL std::
string GetUrlSchemeString() const RR_OVERRIDE;
85 RR_OVIRTUAL std::vector<std::
string> GetServerListenUrls() RR_OVERRIDE;
87 RR_OVIRTUAL
void SendMessage(const RR_INTRUSIVE_PTR<Message>& m) RR_OVERRIDE;
89 RR_OVIRTUAL
void AsyncSendMessage(
90 const RR_INTRUSIVE_PTR<Message>& m,
93 RR_OVIRTUAL
void AsyncCreateTransportConnection(
94 boost::string_ref url, const RR_SHARED_PTR<Endpoint>& e,
95 boost::function<
void(const RR_SHARED_PTR<ITransportConnection>&,
98 RR_OVIRTUAL RR_SHARED_PTR<ITransportConnection> CreateTransportConnection(
99 boost::string_ref url, const RR_SHARED_PTR<Endpoint>& e) RR_OVERRIDE;
101 RR_OVIRTUAL
void CloseTransportConnection(const RR_SHARED_PTR<Endpoint>& e) RR_OVERRIDE;
104 virtual
void AsyncCreateTransportConnection2(
105 const std::
string& noden, const RR_SHARED_PTR<ITransportConnection>& transport,
107 boost::function<
void(const RR_SHARED_PTR<ITransportConnection>&,
110 virtual
void CloseTransportConnection_timed(const boost::system::error_code& err, const RR_SHARED_PTR<Endpoint>& e,
111 const RR_SHARED_PTR<
void>& timer);
114 RR_OVIRTUAL
bool CanConnectService(boost::string_ref url) RR_OVERRIDE;
116 RR_OVIRTUAL
void Close() RR_OVERRIDE;
118 RR_OVIRTUAL
void CheckConnection(uint32_t endpoint) RR_OVERRIDE;
120 RR_OVIRTUAL
void PeriodicCleanupTask() RR_OVERRIDE;
122 RR_OVIRTUAL uint32_t TransportCapability(boost::string_ref name) RR_OVERRIDE;
124 RR_OVIRTUAL
void MessageReceived(const RR_INTRUSIVE_PTR<Message>& m) RR_OVERRIDE;
126 RR_OVIRTUAL
void AsyncGetDetectedNodes(
127 const std::vector<std::
string>& schemes,
128 const boost::function<
void(const RR_SHARED_PTR<std::vector<
NodeDiscoveryInfo> >&)>& handler,
158 virtual
void AddUsbDevice(uint16_t vid, uint16_t pid, uint8_t interface_);
180 virtual
void register_transport(const RR_SHARED_PTR<ITransportConnection>& connection);
181 virtual
void erase_transport(const RR_SHARED_PTR<ITransportConnection>& connection);
183 template <typename T, typename F>
184 boost::signals2::connection AddCloseListener(const RR_SHARED_PTR<T>& t, const F& f)
186 boost::mutex::scoped_lock lock(closed_lock);
191 return boost::signals2::connection();
194 return close_signal.connect(boost::signals2::signal<
void()>::slot_type(boost::bind(f, t.get())).track(t));
198 boost::mutex parameter_lock;
199 int32_t max_message_size;
200 bool disable_message4;
201 bool disable_string_table;
202 bool disable_async_message_io;
204 boost::mutex discovery_lock;
206 RR_SHARED_PTR<void> internal1;
207 RR_SHARED_PTR<void> internal2;
208 RR_SHARED_PTR<void> internal3;
209 RR_SHARED_PTR<void> internal4;
211 std::list<boost::tuple<uint16_t, uint16_t, uint8_t> > usb_devices;
214 boost::mutex closed_lock;
215 boost::signals2::signal<void()> close_signal;