12 #include <boost/asio/io_context.hpp> 15 #include <unordered_map> 34 explicit Client(boost::asio::ip::address fallback_address)
37 explicit Client(
const std::string &fallback_address)
51 template <
typename Functor>
53 boost::asio::io_context &io_context,
60 auto client = std::make_shared<underlying_client>(
63 std::forward<Functor>(callback));
65 _clients.emplace(token.get_stream_id(), std::move(client));
69 log_debug(
"calling sensor UnSubscribe()");
static auto make_localhost_address()
std::unordered_map< detail::stream_id_type, std::shared_ptr< underlying_client > > _clients
A client able to subscribe to multiple streams.
static auto make_address(const std::string &address)
endpoint::protocol_type protocol_type
void set_address(const boost::asio::ip::address &addr)
Client(boost::asio::ip::address fallback_address)
This file contains definitions of common data structures used in traffic manager. ...
static void log_debug(Args &&...)
#define DEBUG_ASSERT_EQ(lhs, rhs)
void UnSubscribe(token_type token)
A client that connects to a single stream.
boost::asio::ip::address _fallback_address
Client(const std::string &fallback_address)
Serializes a stream endpoint.
const auto & get_stream_id() const
typename underlying_client::protocol_type protocol_type
void Subscribe(boost::asio::io_context &io_context, token_type token, Functor &&callback)
carla::streaming::detail::token_type token_type